home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mlib44d.zoo
/
diffc
next >
Wrap
Text File
|
1994-03-01
|
139KB
|
5,339 lines
*** 43.1 1994/02/15 19:34:32
--- a64l.c 1994/02/28 09:32:14
***************
*** 66,72 ****
/* Local function prototypes */
static int a64i __PROTO((char c)); /* base-64 char to int, -1 on error */
- static char i64a __PROTO((int i)); /* integer to base-64 char, 0x7F on error */
/* base-64 char to int, -1 on error */
static int a64i(c)
--- 66,71 ----
***************
*** 112,162 ****
return(retval);
} /* End of a64l() */
- /* integer to base-64 char, 0x7F on error */
- static char i64a(i)
- int i;
- {
- char retval = (char)i;
-
- if ((i < 0) || (i > 63))
- {
- errno = EBADARG;
- return(0x7F);
- }
- retval += '.';
- if (i > 11)
- retval += 'A' - '9' - 1;
- if (i > 37)
- retval += 'a' - 'Z' - 1;
- return(retval);
- } /* End of i64a() */
-
- /* long to base-64 string */
- char *l64a(l)
- long l;
- {
- static char retval[7];
- char buffer[7], *ptr1 = buffer, *ptr2 = retval;
- int counter = 0;
-
- if (l < 0)
- {
- errno = EBADARG;
- return("");
- }
- if (l == 0)
- return("");
- while ((counter++ < 6) && (l > 0))
- {
- char val;
-
- if ((val = i64a((char)(l & 0x3F))) == 0x7F)
- return(""); /* errno was set by i64a() */
- *ptr1++ = val;
- l >>= 6;
- }
- while (ptr1 > buffer)
- *ptr2++ = *(--ptr1);
- *ptr2 = 0x00;
- return(retval);
- } /* End of l64a() */
--- 111,113 ----
*** 43.1 1994/02/15 19:34:32
--- abort.c 1994/02/27 13:14:44
***************
*** 1,4 ****
! /* ERS */
#include <signal.h>
#include <stdlib.h>
--- 1,4 ----
! /* by ERS, modified by entropy */
#include <signal.h>
#include <stdlib.h>
***************
*** 17,31 ****
{
#ifdef __MINT__
if (__mint)
(void) Pkill(Pgetpid(), SIGABRT);
! #if 0
! /* Do not do this because it violates POSIX (raise() and
! kill() are available for the user unless <signal.h> is
! included in user's source). Fix later.
! */
else
raise(SIGABRT);
- #endif
_fclose_all_files();
_exit(127);
#else
--- 17,33 ----
{
#ifdef __MINT__
if (__mint)
+ {
(void) Pkill(Pgetpid(), SIGABRT);
! /* process still alive, maybe SIGABRT was blocked */
! (void) Psigsetmask(Psigblock(0) & ~(sigmask(SIGABRT)));
! /* process still alive, maybe SIGABRT was ignored */
! /* is this correct if user SIGABRT handler returns? */
! (void) Psignal(SIGABRT, (long) SIG_DFL);
! (void) Pkill(Pgetpid(), SIGABRT);
! }
else
raise(SIGABRT);
_fclose_all_files();
_exit(127);
#else
*** 43.1 1994/02/15 19:34:32
--- abs.c 1994/02/28 12:17:48
***************
*** 4,17 ****
#ifdef abs
#undef abs
#endif
- #ifdef labs
- #undef labs
- #endif
int abs(x)
! int x;
! { return x < 0 ? -x : x; }
!
! long labs(x)
! long x;
! { return x < 0 ? -x : x; }
--- 4,12 ----
#ifdef abs
#undef abs
#endif
int abs(x)
! int x;
! {
! return x < 0 ? -x : x;
! }
*** /dev/null Mon Feb 28 07:43:04 1994
--- atoi.c Mon Feb 28 04:38:26 1994
***************
*** 0 ****
--- 1,13 ----
+ #include <stddef.h>
+ #include <stdlib.h>
+ #include <assert.h>
+
+ __EXTERN long strtol __PROTO((const char *, char **, int));
+
+ int
+ atoi(str)
+ const char *str;
+ {
+ assert ((str != NULL));
+ return (int) strtol(str, (char **)0, 10);
+ }
*** 43.1 1994/02/15 19:34:32
--- atol.c 1994/02/28 09:38:36
***************
*** 6,19 ****
__EXTERN long strtol __PROTO((const char *, char **, int));
! int atoi(str)
! const char *str;
! {
! assert ((str != NULL));
! return (int) strtol(str, (char **)0, 10);
! }
!
! long atol(str)
const char *str;
{
assert ((str != NULL));
--- 6,13 ----
__EXTERN long strtol __PROTO((const char *, char **, int));
! long
! atol(str)
const char *str;
{
assert ((str != NULL));
*** 43.1 1994/02/15 19:34:32
--- chmod.c 1994/02/28 09:50:08
***************
*** 1,5 ****
/* chmod -- change the permissions of a file */
- /* chown -- change the owner and group of a file */
/* written by Eric R. Smith and placed in the public domain */
#include <types.h>
--- 1,4 ----
***************
*** 13,19 ****
extern int __mint;
! int chmod(_path, mode)
const char *_path;
int mode;
{
--- 12,19 ----
extern int __mint;
! int
! chmod(_path, mode)
const char *_path;
int mode;
{
***************
*** 60,84 ****
return 0;
}
- /*
- * chown: this is faked if MiNT is not running
- */
-
- int chown(_name, uid, gid)
- const char *_name;
- int uid, gid;
- {
- int r;
- char name[PATH_MAX];
-
- if (__mint >= 9) {
- (void)_unx2dos(_name, name);
- r = (int)Fchown(name, uid, gid);
- if (r && (r != -EINVAL)) {
- errno = -r;
- return -1;
- }
- return 0;
- }
- return 0;
- }
--- 60,62 ----
*** /dev/null Mon Feb 28 07:43:04 1994
--- chown.c Mon Feb 28 04:50:02 1994
***************
*** 0 ****
--- 1,34 ----
+ /* chown -- change the owner and group of a file */
+ /* written by Eric R. Smith and placed in the public domain */
+ /* this is faked if MiNT is not running */
+
+ #include <types.h>
+ #include <stat.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include <limits.h>
+ #include <errno.h>
+ #include <unistd.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ int
+ chown(_name, uid, gid)
+ const char *_name;
+ int uid, gid;
+ {
+ int r;
+ char name[PATH_MAX];
+
+ if (__mint >= 9) {
+ (void)_unx2dos(_name, name);
+ r = (int)Fchown(name, uid, gid);
+ if (r && (r != -EINVAL)) {
+ errno = -r;
+ return -1;
+ }
+ return 0;
+ }
+ return 0;
+ }
*** 43.1 1994/02/15 19:34:32
--- div.c 1994/02/28 10:12:58
***************
*** 1,5 ****
/*
! * div and ldiv
* this one should be compat with -fpcc-struct-return
*
* ++jrb bammi@dsrgsun.ces.cwru.edu
--- 1,5 ----
/*
! * div
* this one should be compat with -fpcc-struct-return
*
* ++jrb bammi@dsrgsun.ces.cwru.edu
***************
*** 11,17 ****
long __divsi3(long, long); /* returns: quot in d0.l remainder in d1.l */
#ifdef __MSHORT__
! div_t div(int num, int denom)
{
div_t result;
--- 11,18 ----
long __divsi3(long, long); /* returns: quot in d0.l remainder in d1.l */
#ifdef __MSHORT__
! div_t
! div(int num, int denom)
{
div_t result;
***************
*** 29,52 ****
#else /* !__MSHORT__ */
__asm__(".stabs \"_div\",5,0,0,_ldiv");
#endif
-
- ldiv_t ldiv(long num, long denom)
- {
- ldiv_t result;
-
- __asm__ volatile("\
- movl %3,sp@-
- movl %2,sp@-
- jsr ___divsi3
- addqw #8,sp
- movl d0,%0
- movl d1,%1"
- : "=g"(result.quot), "=g"(result.rem)
- : "r"(num), "r"(denom)
- ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
- return result;
- }
-
#else /* !__GNUC__ */
div_t
--- 30,35 ----
***************
*** 54,71 ****
int num, denom;
{
div_t res;
-
- res.quot = num / denom;
- res.rem = num % denom;
-
- return res;
- }
-
- ldiv_t
- ldiv(num, denom)
- long num, denom;
- {
- ldiv_t res;
res.quot = num / denom;
res.rem = num % denom;
--- 37,42 ----
*** /dev/null Mon Feb 28 07:43:04 1994
--- fgetpos.c Mon Feb 28 06:30:12 1994
***************
*** 0 ****
--- 1,19 ----
+ /* from Dale Schumacher's dLibs */
+
+ #include <stdio.h>
+
+ int
+ fgetpos(fp, pos)
+ FILE *fp;
+ fpos_t *pos;
+ {
+ register long rv;
+
+ rv = ftell(fp);
+ if ((rv >= 0) && pos)
+ {
+ *pos = rv;
+ return (0);
+ }
+ return (-1);
+ }
*** 43.1 1994/02/15 19:34:32
--- fopen.c 1994/02/28 11:06:46
***************
*** 5,160 ****
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
__EXTERN void _getbuf __PROTO((FILE *));
- static FILE *_fopen __PROTO((const char *, const char *, FILE *));
! extern int __mint;
!
! /* lowest character device handle # */
! #define LAST_DEVICE __SMALLEST_VALID_HANDLE
!
! extern int __default_mode__;
!
! static FILE *_fopen(filename, mode, fp)
! const char *filename;
! const char *mode;
! FILE *fp;
! /*
! * INTERNAL FUNCTION. Attempt to open <filename> in the given
! * <mode> and attach it to the stream <fp>
! */
! {
! register int h, i, iomode = 0, f = __default_mode__;
!
! while(*mode)
! {
! switch(*mode++)
! {
! case 'r':
! f |= _IOREAD;
! break;
! case 'w':
! f |= _IOWRT;
! iomode |= (O_CREAT | O_TRUNC);
! break;
! case 'a':
! f |= _IOWRT;
! iomode |= (O_CREAT | O_APPEND);
! break;
! case '+':
! f &= ~(_IOREAD | _IOWRT);
! f |= _IORW;
! break;
! case 'b':
! f |= _IOBIN;
! break;
! case 't':
! f &= ~_IOBIN;
! break;
! default:
! return(NULL);
! }
! }
! if((i = (f & (_IORW | _IOREAD | _IOWRT))) == 0)
! return(NULL);
! else if(i == _IOREAD)
! iomode |= O_RDONLY;
! else if(i == _IOWRT)
! iomode |= O_WRONLY;
! else
! iomode |= O_RDWR;
! iomode |= O_NOCTTY;
! h = open(filename, iomode, 0666);
! if(h < __SMALLEST_VALID_HANDLE)
! {
! return(NULL); /* file open/create error */
! }
! if(isatty(h))
! f |= __mint ? (_IODEV | _IONBF| _IOBIN) : (_IODEV | _IONBF);
! else
! f |= _IOFBF;
! fp->_file = h; /* file handle */
! fp->_flag = f; /* file status flags */
! if (iomode & O_APPEND)
! (void) fseek(fp, 0L, SEEK_END);
!
! return(fp);
! }
!
! FILE *fopen(filename, mode)
! const char *filename, *mode;
! {
! register int i;
! register FILE *fp = NULL;
!
! for(i=0; (!fp && (i < _NFILE)); ++i)
! if(!(_iob[i]._flag & (_IORW | _IOREAD | _IOWRT)))
! fp = &_iob[i]; /* empty slot */
! if(fp != NULL)
! {
! if(_fopen(filename, mode, fp) == NULL)
! return NULL;
! _getbuf(fp);
! return fp;
! }
! else
! {
! errno = EMFILE;
! return NULL;
! }
! }
!
! /*
! * re-coded, foobared code deleted
! *
! * ++jrb
! */
! FILE *freopen(filename, mode, fp)
const char *filename, *mode;
- FILE *fp;
{
! unsigned int f;
!
! if(fp == NULL) return NULL;
!
! f = fp->_flag;
! if((f & (_IORW | _IOREAD | _IOWRT)) != 0)
! { /* file not closed, close it */
! #if 0
! if(fflush(fp) != 0) return NULL; /* flush err */
! if(close(fp->_file) != 0) return NULL; /* close err */
! #else
! fflush(fp); /* ANSI says ignore errors */
! if (__mint || !(f & _IODEV)) /* leave tty's alone */
! close(fp->_file);
! #endif
! }
! /* save buffer discipline and setbuf settings, and _IOWRT just for
! determinining line buffering after the next _fopen */
! f &= (_IOFBF | _IOLBF | _IONBF | _IOMYBUF | _IOWRT);
!
! /* open the new file according to mode */
! if((fp = _fopen(filename, mode, fp)) == NULL)
! return NULL;
! if(fp->_flag & _IODEV)
! { /* we are re-opening to a tty */
! if((f & _IOFBF) && (f & _IOWRT) && (f & _IOMYBUF))
! { /* was a FBF & WRT & !setvbuff'ed */
! /* reset to line buffering */
! f &= ~_IOFBF;
! f |= _IOLBF;
! }
! }
! f &= ~_IOWRT; /* get rid of saved _IOWRT flag */
!
! /* put buffering and discipline flags in new fp->_flag */
! fp->_flag &= ~(_IONBF | _IOLBF | _IOFBF | _IOMYBUF);
! fp->_flag |= f;
!
! if (fp->_base == NULL)
! /* get new buffer if file was closed */
! _getbuf (fp);
return fp;
! }
--- 5,34 ----
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
+ #include "lib.h"
__EXTERN void _getbuf __PROTO((FILE *));
! FILE *
! fopen(filename, mode)
const char *filename, *mode;
{
! register int i;
! register FILE *fp = NULL;
+ for (i=0; (!fp && (i < _NFILE)); ++i)
+ if (!(_iob[i]._flag & (_IORW | _IOREAD | _IOWRT)))
+ fp = &_iob[i]; /* empty slot */
+ if (fp != NULL)
+ {
+ if (_fopen_i(filename, mode, fp) == NULL)
+ return NULL;
+ _getbuf(fp);
return fp;
! }
! else
! {
! errno = EMFILE;
! return NULL;
! }
! }
*** /dev/null Mon Feb 28 07:43:04 1994
--- fopen_i.c Mon Feb 28 06:06:38 1994
***************
*** 0 ****
--- 1,79 ----
+ /* from Dale Schumacher's dLibs */
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ extern int __default_mode__;
+
+ FILE *
+ _fopen_i(filename, mode, fp)
+ const char *filename;
+ const char *mode;
+ FILE *fp;
+ /*
+ * INTERNAL FUNCTION. Attempt to open <filename> in the given
+ * <mode> and attach it to the stream <fp>
+ */
+ {
+ register int h, i, iomode = 0, f = __default_mode__;
+
+ while (*mode)
+ {
+ switch (*mode++)
+ {
+ case 'r':
+ f |= _IOREAD;
+ break;
+ case 'w':
+ f |= _IOWRT;
+ iomode |= (O_CREAT | O_TRUNC);
+ break;
+ case 'a':
+ f |= _IOWRT;
+ iomode |= (O_CREAT | O_APPEND);
+ break;
+ case '+':
+ f &= ~(_IOREAD | _IOWRT);
+ f |= _IORW;
+ break;
+ case 'b':
+ f |= _IOBIN;
+ break;
+ case 't':
+ f &= ~_IOBIN;
+ break;
+ default:
+ return(NULL);
+ }
+ }
+ if ((i = (f & (_IORW | _IOREAD | _IOWRT))) == 0)
+ return(NULL);
+ else if (i == _IOREAD)
+ iomode |= O_RDONLY;
+ else if (i == _IOWRT)
+ iomode |= O_WRONLY;
+ else
+ iomode |= O_RDWR;
+ iomode |= O_NOCTTY;
+ h = open(filename, iomode, 0666);
+ if (h < __SMALLEST_VALID_HANDLE)
+ {
+ return(NULL); /* file open/create error */
+ }
+ if (isatty(h))
+ f |= __mint ? (_IODEV | _IONBF| _IOBIN) : (_IODEV | _IONBF);
+ else
+ f |= _IOFBF;
+ fp->_file = h; /* file handle */
+ fp->_flag = f; /* file status flags */
+ if (iomode & O_APPEND)
+ (void) fseek(fp, 0L, SEEK_END);
+
+ return (fp);
+ }
+
*** 43.1 1994/02/15 19:34:32
--- fputs.c 1994/02/28 11:12:14
***************
*** 4,33 ****
#include <stddef.h>
#include <assert.h>
! int fputs(data, fp)
! register const char *data;
! register FILE *fp;
! {
! register int n = 0;
! assert((data != NULL));
! while(*data)
! {
! if(fputc(*data++, fp) == EOF)
! return(EOF);
! ++n;
! }
! return(n);
! }
!
! int puts(data)
! const char *data;
! {
! register int n;
!
! assert((data != NULL));
! if(((n = fputs(data, stdout)) == EOF)
! || (fputc('\n', stdout) == EOF))
! return(EOF);
! return(++n);
! }
--- 4,22 ----
#include <stddef.h>
#include <assert.h>
! int
! fputs(data, fp)
! register const char *data;
! register FILE *fp;
! {
! register int n = 0;
! assert((data != NULL));
! while (*data)
! {
! if (fputc(*data++, fp) == EOF)
! return (EOF);
! ++n;
! }
! return (n);
! }
*** /dev/null Mon Feb 28 07:43:04 1994
--- freopen.c Mon Feb 28 06:08:30 1994
***************
*** 0 ****
--- 1,65 ----
+ /* from Dale Schumacher's dLibs */
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ /*
+ * re-coded, foobared code deleted
+ *
+ * ++jrb
+ */
+ FILE *
+ freopen(filename, mode, fp)
+ const char *filename, *mode;
+ FILE *fp;
+ {
+ unsigned int f;
+
+ if (fp == NULL)
+ return NULL;
+
+ f = fp->_flag;
+ if ((f & (_IORW | _IOREAD | _IOWRT)) != 0)
+ { /* file not closed, close it */
+ #if 0
+ if (fflush(fp) != 0) return NULL; /* flush err */
+ if (close(fp->_file) != 0) return NULL; /* close err */
+ #else
+ fflush(fp); /* ANSI says ignore errors */
+ if (__mint || !(f & _IODEV)) /* leave tty's alone */
+ close(fp->_file);
+ #endif
+ }
+ /* save buffer discipline and setbuf settings, and _IOWRT just for
+ determinining line buffering after the next _fopen_i */
+ f &= (_IOFBF | _IOLBF | _IONBF | _IOMYBUF | _IOWRT);
+
+ /* open the new file according to mode */
+ if ((fp = _fopen_i(filename, mode, fp)) == NULL)
+ return NULL;
+ if (fp->_flag & _IODEV)
+ { /* we are re-opening to a tty */
+ if ((f & _IOFBF) && (f & _IOWRT) && (f & _IOMYBUF))
+ { /* was a FBF & WRT & !setvbuff'ed */
+ /* reset to line buffering */
+ f &= ~_IOFBF;
+ f |= _IOLBF;
+ }
+ }
+ f &= ~_IOWRT; /* get rid of saved _IOWRT flag */
+
+ /* put buffering and discipline flags in new fp->_flag */
+ fp->_flag &= ~(_IONBF | _IOLBF | _IOFBF | _IOMYBUF);
+ fp->_flag |= f;
+
+ if (fp->_base == NULL)
+ /* get new buffer if file was closed */
+ _getbuf (fp);
+
+ return fp;
+ }
*** 43.1 1994/02/15 19:34:32
--- fseek.c 1994/02/28 11:26:22
***************
*** 5,51 ****
#include <stdio.h>
#include <unistd.h>
! long ftell(fp)
! FILE *fp;
! {
! long rv, count = fp->_cnt, adjust = 0;
! unsigned int f = fp->_flag;
!
! if( ((f & _IOREAD) && (!(f & _IOBIN))) ||
! (count == 0) ||
! (f & _IONBF) )
! {
! fflush(fp);
! rv = lseek(fp->_file, 0L, SEEK_CUR);
! }
! else
! {
! if(f & _IOREAD)
! adjust = -count;
! else if(f & (_IOWRT | _IORW))
! {
! if(f & _IOWRT)
! adjust = count;
! }
! else return -1L;
!
! rv = lseek(fp->_file, 0L, SEEK_CUR);
! }
! return (rv < 0) ? -1L : rv + adjust;
! }
!
! void rewind(fp)
! register FILE *fp;
! {
! fflush(fp);
! (void) lseek(fp->_file, 0L, SEEK_SET);
! fp->_flag &= ~(_IOEOF|_IOERR);
! }
!
! int fseek(fp, offset, origin)
! FILE *fp;
! long offset;
! int origin;
{
long pos, count;
unsigned int f;
--- 5,15 ----
#include <stdio.h>
#include <unistd.h>
! int
! fseek(fp, offset, origin)
! FILE *fp;
! long offset;
! int origin;
{
long pos, count;
unsigned int f;
*** 43.1 1994/02/15 19:34:32
--- fsetpos.c 1994/02/28 11:29:28
***************
*** 2,38 ****
#include <stdio.h>
! #define ERROR -1
! int fgetpos(fp, pos)
! FILE *fp;
! fpos_t *pos;
! {
! register long rv;
!
! rv = ftell(fp);
! if((rv >= 0) && pos)
! {
! *pos = rv;
! return(0);
! }
! return(ERROR);
! }
!
! int fsetpos(fp, pos)
! FILE *fp;
! fpos_t *pos;
! {
! register long rv;
!
! if(pos)
! {
! rv = fseek(fp, *pos, SEEK_SET);
! if(rv >= 0)
! {
! fp->_flag &= ~(_IOEOF|_IOERR);
! return(0);
! }
! }
! return(ERROR);
! }
--- 2,22 ----
#include <stdio.h>
! int
! fsetpos(fp, pos)
! FILE *fp;
! fpos_t *pos;
! {
! register long rv;
! if (pos)
! {
! rv = fseek(fp, *pos, SEEK_SET);
! if (rv >= 0)
! {
! fp->_flag &= ~(_IOEOF|_IOERR);
! return (0);
! }
! }
! return (-1);
! }
*** /dev/null Mon Feb 28 07:43:04 1994
--- ftell.c Mon Feb 28 06:23:50 1994
***************
*** 0 ****
--- 1,36 ----
+ /* something like the origonal
+ * from Dale Schumacher's dLibs
+ */
+
+ #include <stdio.h>
+ #include <unistd.h>
+
+ long
+ ftell(fp)
+ FILE *fp;
+ {
+ long rv, count = fp->_cnt, adjust = 0;
+ unsigned int f = fp->_flag;
+
+ if (((f & _IOREAD) && (!(f & _IOBIN)))
+ || (count == 0)
+ || (f & _IONBF))
+ {
+ fflush(fp);
+ rv = lseek(fp->_file, 0L, SEEK_CUR);
+ }
+ else
+ {
+ if (f & _IOREAD)
+ adjust = -count;
+ else if (f & (_IOWRT | _IORW))
+ {
+ if(f & _IOWRT)
+ adjust = count;
+ }
+ else return -1L;
+
+ rv = lseek(fp->_file, 0L, SEEK_CUR);
+ }
+ return (rv < 0) ? -1L : rv + adjust;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- getegid.c Mon Feb 28 07:03:30 1994
***************
*** 0 ****
--- 1,12 ----
+ #include <types.h>
+ #include <unistd.h>
+ #include <mintbind.h>
+
+ extern int __mint;
+
+ gid_t
+ getegid()
+ {
+ return __mint >= 95 ? Pgetegid() : getgid();
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- geteuid.c Mon Feb 28 07:02:50 1994
***************
*** 0 ****
--- 1,11 ----
+ #include <types.h>
+ #include <unistd.h>
+ #include <mintbind.h>
+
+ extern int __mint;
+
+ uid_t
+ geteuid()
+ {
+ return __mint >= 95 ? Pgeteuid() : getuid();
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- getgid.c Mon Feb 28 07:02:34 1994
***************
*** 0 ****
--- 1,12 ----
+ #include <types.h>
+ #include <unistd.h>
+ #include <mintbind.h>
+
+ extern int __mint;
+ extern gid_t __gid;
+
+ gid_t
+ getgid()
+ {
+ return __mint ? Pgetgid() : __gid;
+ }
*** 43.1 1994/02/15 19:34:32
--- getpid.c 1994/02/28 11:42:08
***************
*** 5,9 ****
extern int __mint;
! int getpid() { return __mint ? Pgetpid() : (int) ( ((long)_base) >> 8 ); }
! int getppid() { return __mint ? Pgetppid() : (int) (((long)(_base->p_parent)) >> 8); }
--- 5,12 ----
extern int __mint;
! int
! getpid()
! {
! return __mint ? Pgetpid() : (int) ( ((long)_base) >> 8 );
! }
*** /dev/null Mon Feb 28 07:43:04 1994
--- getppid.c Mon Feb 28 06:41:40 1994
***************
*** 0 ****
--- 1,12 ----
+ #include <osbind.h>
+ #include <unistd.h>
+ #include <basepage.h>
+ #include <mintbind.h>
+
+ extern int __mint;
+
+ int
+ getppid()
+ {
+ return __mint ? Pgetppid() : (int) (((long)(_base->p_parent)) >> 8);
+ }
*** 43.1 1994/02/15 19:34:32
--- getuid.c 1994/02/28 12:01:08
***************
*** 1,71 ****
! #ifdef __TURBOC__
! #include <sys\types.h>
! #else
! #include <sys/types.h>
! #endif
#include <unistd.h>
#include <osbind.h>
#include <mintbind.h>
- #include <errno.h>
extern int __mint;
! static int __uid = 0, __gid = 0;
!
! uid_t getuid() { return __mint ? Pgetuid() : __uid; }
! gid_t getgid() { return __mint ? Pgetgid() : __gid; }
!
! uid_t geteuid()
! { return __mint >= 95 ? Pgeteuid() : getuid(); }
!
! gid_t getegid()
! { return __mint >= 95 ? Pgetegid() : getgid(); }
!
! int setuid(x)
! int x;
! {
! long r;
!
! if (__mint) {
! r = Psetuid(x);
! if (r < 0) {
! errno = (int) -r;
! return -1;
! }
! return 0;
! }
! __uid = x;
! return 0;
! }
!
! int setgid(x)
! int x;
{
! long r;
!
! if (__mint) {
! r = Psetgid(x);
! if (r < 0) {
! errno = (int) -r;
! return -1;
! }
! return 0;
! }
! __gid = x;
! return 0;
! }
!
! int setreuid(ruid,euid)
! int ruid, euid;
! {
! return setuid(euid);
}
-
- int setregid(rgid,egid)
- int rgid, egid;
- {
- return setgid(egid);
- }
-
- int seteuid(x) int x; { return setuid(x); }
- int setegid(x) int x; { return setgid(x); }
--- 1,13 ----
! #include <types.h>
#include <unistd.h>
#include <osbind.h>
#include <mintbind.h>
extern int __mint;
+ extern uid_t __uid;
! uid_t
! getuid()
{
! return __mint ? Pgetuid() : __uid;
}
*** /dev/null Mon Feb 28 07:43:04 1994
--- l64a.c Mon Feb 28 04:32:22 1994
***************
*** 0 ****
--- 1,58 ----
+ #include <support.h>
+ #include <errno.h>
+ extern int errno;
+
+ #ifndef _COMPILER_H
+ #include <compiler.h>
+ #endif
+
+ static char i64a __PROTO((int i)); /* integer to base-64 char, 0x7F on error */
+
+ /* integer to base-64 char, 0x7F on error */
+ static char i64a(i)
+ int i;
+ {
+ char retval = (char)i;
+
+ if ((i < 0) || (i > 63))
+ {
+ errno = EBADARG;
+ return(0x7F);
+ }
+ retval += '.';
+ if (i > 11)
+ retval += 'A' - '9' - 1;
+ if (i > 37)
+ retval += 'a' - 'Z' - 1;
+ return(retval);
+ } /* End of i64a() */
+
+ /* long to base-64 string */
+ char *l64a(l)
+ long l;
+ {
+ static char retval[7];
+ char buffer[7], *ptr1 = buffer, *ptr2 = retval;
+ int counter = 0;
+
+ if (l < 0)
+ {
+ errno = EBADARG;
+ return("");
+ }
+ if (l == 0)
+ return("");
+ while ((counter++ < 6) && (l > 0))
+ {
+ char val;
+
+ if ((val = i64a((char)(l & 0x3F))) == 0x7F)
+ return(""); /* errno was set by i64a() */
+ *ptr1++ = val;
+ l >>= 6;
+ }
+ while (ptr1 > buffer)
+ *ptr2++ = *(--ptr1);
+ *ptr2 = 0x00;
+ return(retval);
+ } /* End of l64a() */
*** /dev/null Mon Feb 28 07:43:04 1994
--- labs.c Mon Feb 28 07:17:38 1994
***************
*** 0 ****
--- 1,13 ----
+ /* return absolute values */
+ #include <stdlib.h>
+
+ #ifdef labs
+ #undef labs
+ #endif
+
+ long
+ labs(x)
+ long x;
+ {
+ return x < 0 ? -x : x;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- ldiv.c Mon Feb 28 05:11:00 1994
***************
*** 0 ****
--- 1,45 ----
+ /*
+ * ldiv
+ * this one should be compat with -fpcc-struct-return
+ *
+ * ++jrb bammi@dsrgsun.ces.cwru.edu
+ */
+ #include <stdlib.h>
+
+ #ifdef __GNUC__
+
+ long __divsi3(long, long); /* returns: quot in d0.l remainder in d1.l */
+
+ ldiv_t
+ ldiv(long num, long denom)
+ {
+ ldiv_t result;
+
+ __asm__ volatile("\
+ movl %3,sp@-
+ movl %2,sp@-
+ jsr ___divsi3
+ addqw #8,sp
+ movl d0,%0
+ movl d1,%1"
+ : "=g"(result.quot), "=g"(result.rem)
+ : "r"(num), "r"(denom)
+ ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
+ return result;
+ }
+
+ #else /* !__GNUC__ */
+
+ ldiv_t
+ ldiv(num, denom)
+ long num, denom;
+ {
+ ldiv_t res;
+
+ res.quot = num / denom;
+ res.rem = num % denom;
+
+ return res;
+ }
+
+ #endif /* !__GNUC__ */
*** 43.1 1994/02/15 19:34:32
--- lib.h 1994/02/28 14:01:22
***************
*** 50,55 ****
--- 50,56 ----
#ifdef __MINT__
__EXTERN int _scanf __PROTO((FILE *, int (*)(FILE *),
int (*)(int, FILE *), const char *, __VA_LIST__));
+ __EXTERN int _enoent __PROTO((char *));
#endif
__EXTERN long get_sysvar __PROTO((void *var));
***************
*** 116,120 ****
--- 117,133 ----
#define FH_UNKNOWN 0
#define FH_ISATTY 1
#define FH_ISAFILE 2
+
+ /*
+ * macro for converting a long in DOS format to one in Unix format. "x"
+ * _must_ be an lvalue!
+ */
+ #define __UNIXTIME(x) (x = _unixtime( ((short *)&x)[0], ((short *)&x)[1] ))
+
+ __EXTERN int _do_lock __PROTO((int fd, int cmd, long size, int whence));
+
+ #ifdef _STDIO_H
+ __EXTERN FILE *_fopen_i __PROTO((const char *, const char *, FILE *));
+ #endif
#endif /* _LIB_H */
*** /dev/null Mon Feb 28 07:43:04 1994
--- puts.c Mon Feb 28 06:12:00 1994
***************
*** 0 ****
--- 1,18 ----
+ /* from Dale Schumacher's dLibs */
+
+ #include <stdio.h>
+ #include <stddef.h>
+ #include <assert.h>
+
+ int
+ puts(data)
+ const char *data;
+ {
+ register int n;
+
+ assert((data != NULL));
+ if (((n = fputs(data, stdout)) == EOF)
+ || (fputc('\n', stdout) == EOF))
+ return (EOF);
+ return (++n);
+ }
*** 43.1 1994/02/15 19:34:32
--- regexp.c 1994/02/24 16:39:52
***************
*** 591,596 ****
--- 591,597 ----
place = opnd; /* Op node, where operand used to be. */
*place++ = op;
+ *place++ = '\0';
*place = '\0';
}
*** /dev/null Mon Feb 28 07:43:04 1994
--- rewind.c Mon Feb 28 06:25:06 1994
***************
*** 0 ****
--- 1,16 ----
+ /* something like the origonal
+ * from Dale Schumacher's dLibs
+ */
+
+ #include <stdio.h>
+ #include <unistd.h>
+
+ void
+ rewind(fp)
+ register FILE *fp;
+ {
+ fflush(fp);
+ (void) lseek(fp->_file, 0L, SEEK_SET);
+ fp->_flag &= ~(_IOEOF|_IOERR);
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- setegid.c Mon Feb 28 07:00:42 1994
***************
*** 0 ****
--- 1,8 ----
+ #include <unistd.h>
+
+ int
+ setegid(x)
+ int x;
+ {
+ return setgid(x);
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- seteuid.c Mon Feb 28 06:59:24 1994
***************
*** 0 ****
--- 1,8 ----
+ #include <unistd.h>
+
+ int
+ seteuid(x)
+ int x;
+ {
+ return setuid(x);
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- setgid.c Mon Feb 28 07:05:22 1994
***************
*** 0 ****
--- 1,27 ----
+ #include <types.h>
+ #include <unistd.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include <errno.h>
+
+ extern int __mint;
+ extern gid_t __gid;
+
+ int
+ setgid(x)
+ int x;
+ {
+ long r;
+
+ if (__mint) {
+ r = Psetgid(x);
+ if (r < 0) {
+ errno = (int) -r;
+ return -1;
+ }
+ return 0;
+ }
+ __gid = x;
+ return 0;
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- setregid.c Mon Feb 28 06:58:10 1994
***************
*** 0 ****
--- 1,9 ----
+ #include <unistd.h>
+
+ int
+ setregid(rgid,egid)
+ int rgid, egid;
+ {
+ return setgid(egid);
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- setreuid.c Mon Feb 28 06:58:34 1994
***************
*** 0 ****
--- 1,9 ----
+ #include <unistd.h>
+
+ int
+ setreuid(ruid,euid)
+ int ruid, euid;
+ {
+ return setuid(euid);
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- setuid.c Mon Feb 28 07:04:32 1994
***************
*** 0 ****
--- 1,26 ----
+ #include <types.h>
+ #include <unistd.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include <errno.h>
+
+ extern int __mint;
+ extern uid_t __uid;
+
+ int
+ setuid(x)
+ int x;
+ {
+ long r;
+
+ if (__mint) {
+ r = Psetuid(x);
+ if (r < 0) {
+ errno = (int) -r;
+ return -1;
+ }
+ return 0;
+ }
+ __uid = x;
+ return 0;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- uidgid.c Mon Feb 28 06:50:42 1994
***************
*** 0 ****
--- 1,5 ----
+ #include <types.h>
+
+ uid_t __uid = 0;
+ gid_t __gid = 0;
+
*** 43.1 1994/02/15 19:34:32
--- Bugs 1994/02/27 12:49:50
***************
*** 39,50 ****
definitions from the include file. That should be easier to track down
than a hung compiler, at least. -entropy]
- abort.c: ++entropy
- If my understanding is correct, abort() should unmask SIGABRT, and also
- set SIGABRT's signal handler to SIG_DFL if it was SIG_IGN, before raising
- the signal. Would someone with a copy of the POSIX spec please look into
- this?
-
access.c: ++entropy
I think my "superuser can access anything" assumption is wrong, especially
if checking execute permissions.
--- 39,44 ----
***************
*** 150,160 ****
open.c: ++nox
Should open() do a TIOCSPGRP too when it Fforces the control tty?
I think, but i'm not 100% sure...
! Currently errno is set to EPATH (ENOTDIR) in some cases where UNIX would
! give EFILNF (ENOENT). The GEMDOS error codes should be translated by the
! library in these cases. This affects open() and creat(), and possibly
! other functions as well (check access(), unlink(), mkdir(), anything that
! accesses files by name).
pgrp.c: ++entropy
The setsid() function never really disassociates the controlling tty from
--- 144,150 ----
open.c: ++nox
Should open() do a TIOCSPGRP too when it Fforces the control tty?
I think, but i'm not 100% sure...
! [The kernel does this for us automagically. -entropy]
pgrp.c: ++entropy
The setsid() function never really disassociates the controlling tty from
***************
*** 177,187 ****
scanf.c: ++jrb
Evidently loses big time. Run Gcctests and find out what's what.
! sigactio.c: ++nox@jelal.north.de, ++entropy
! sigblock() could be declared int at least #ifndef __MSHORT__. The
! functions sigpending(), sigprocmask(), and sigsuspend() have not been
! tested. The other new POSIX sig*() functions have been tested but not
! exhaustively.
sleep.c: ++boender, ++entropy
sleep() will never sleep for more than LONG_MAX / 1000 (approximately 2
--- 167,177 ----
scanf.c: ++jrb
Evidently loses big time. Run Gcctests and find out what's what.
! sigactio.c, sigblock.c: ++nox@jelal.north.de, ++entropy
! sigblock() and sigsetmask() could be declared int at least #ifndef
! __MSHORT__. The functions sigpending(), sigprocmask(), and sigsuspend()
! have not been tested. The other new POSIX sig*() functions have been
! tested but not exhaustively.
sleep.c: ++boender, ++entropy
sleep() will never sleep for more than LONG_MAX / 1000 (approximately 2
***************
*** 226,231 ****
--- 216,223 ----
tfork() doesn't know about -mbaserel, had to save a4 (base pointer)
myself for the child. (and all this only because we still don't have a
real vfork...)
+ [There's now some code that may fix this, but I've only tested it
+ briefly. -entropy]
types.h: ++entropy
Need ssize_t for POSIX compliance.
*** 43.1 1994/02/15 19:34:32
--- Changelog 1994/03/01 05:05:10
***************
*** 4,9 ****
--- 4,605 ----
Changes are listed in *reverse* order, most recent changes being
first.
+ PATCHLEVEL44::
+
+ ***** a64l.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:27:40; author: entropy; state: Exp; lines: +0 -49
+ broke out functions
+ =============================================================================
+ ***** abort.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/27 13:16:42; author: entropy; state: Exp; lines: +9 -7
+ A possibly more ANSI/POSIX compliant abort().
+ =============================================================================
+ ***** abs.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:33:08; author: entropy; state: Exp; lines: +4 -9
+ broke out functions
+ =============================================================================
+ ***** atoi.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:33:32; author: entropy; state: Exp;
+ NEW file, broken out from atol.c
+ =============================================================================
+ ***** atol.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:34:10; author: entropy; state: Exp; lines: +2 -8
+ broke out functions
+ =============================================================================
+ ***** chmod.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +2 -24
+ broke out functions
+ =============================================================================
+ ***** chown.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 18:37:20; author: entropy; state: Exp;
+ NEW file, broken out from chmod.c
+ =============================================================================
+ ***** div.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +3 -32
+ broke out functions
+ =============================================================================
+ ***** fgetpos.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:50:12; author: entropy; state: Exp;
+ NEW file, broken out from fsetpos.c
+ =============================================================================
+ ***** fopen.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +20 -146
+ broke out functions
+ =============================================================================
+ ***** fopen_i.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:46:12; author: entropy; state: Exp;
+ NEW file, broken out from fopen.c
+ =============================================================================
+ ***** fputs.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +15 -26
+ broke out functions
+ =============================================================================
+ ***** freopen.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:46:12; author: entropy; state: Exp;
+ NEW file, broken out from fopen.c
+ =============================================================================
+ ***** fseek.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +5 -41
+ broke out functions
+ =============================================================================
+ ***** fsetpos.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +17 -33
+ broke out functions
+ =============================================================================
+ ***** ftell.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:49:16; author: entropy; state: Exp;
+ NEW file, broken out from fseek.c
+ =============================================================================
+ ***** getegid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** geteuid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** getgid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** getpid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +5 -2
+ broke out functions
+ =============================================================================
+ ***** getppid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:50:12; author: entropy; state: Exp;
+ NEW file, broken out from getpid.c
+ =============================================================================
+ ***** getuid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +5 -63
+ broke out functions
+ =============================================================================
+ ***** l64a.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:27:04; author: entropy; state: Exp;
+ NEW file, broke out from a64l.c.
+ =============================================================================
+ ***** labs.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:28:50; author: entropy; state: Exp;
+ NEW file, formerly in abs.c
+ =============================================================================
+ ***** ldiv.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:42:52; author: entropy; state: Exp;
+ NEW file, broken out from div.c
+ =============================================================================
+ ***** lib.h
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 14:03:04; author: entropy; state: Exp; lines: +12 -0
+ add some prototypes
+ ----------------------------
+ revision 43.2
+ date: 1994/02/27 11:51:30; author: entropy; state: Exp; lines: +1 -0
+ add _enoent() prototype.
+ =============================================================================
+ ***** puts.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:47:38; author: entropy; state: Exp;
+ NEW file, broken out from fputs.c
+ =============================================================================
+ ***** regexp.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/24 16:41:16; author: schwab; state: Exp; lines: +1 -0
+ regcomp fails to compile "(a+|b)*" (from libtest/tregex.c). The bug
+ is an uninitialized byte in reginsert.
+ =============================================================================
+ ***** rewind.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:49:16; author: entropy; state: Exp;
+ NEW file, broken out from fseek.c
+ =============================================================================
+ ***** setegid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** seteuid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** setgid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** setregid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** setreuid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** setuid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** uidgid.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:52:34; author: entropy; state: Exp;
+ NEW file, broken out from getuid.c
+ =============================================================================
+ ***** include/PatchLev.h
+ ----------------------------
+ revision 43.2
+ date: 1994/02/15 20:33:52; author: entropy; state: Exp; lines: +1 -1
+ -
+ =============================================================================
+ ***** include/ioctl.h
+ ----------------------------
+ revision 43.5
+ date: 1994/02/27 09:42:40; author: entropy; state: Exp; lines: +13 -8
+ Add some more TIOCM_* definitions
+ ----------------------------
+ revision 43.4
+ date: 1994/02/21 19:31:36; author: entropy; state: Exp; lines: +29 -0
+ Catch up with MiNT's file.h: Add cursor ioctl's and some missing
+ process ioctl's.
+ ----------------------------
+ revision 43.3
+ date: 1994/02/21 19:20:24; author: entropy; state: Exp; lines: +9 -0
+ Add TIOCMGET (faked) and related bitmasks.
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 14:25:04; author: entropy; state: Exp; lines: +11 -9
+ Added TIOCSDTR, TIOCCDTR and cleaned up a bit.
+ =============================================================================
+ ***** include/mintbind.h
+ ----------------------------
+ revision 43.2
+ date: 1994/02/26 08:45:42; author: entropy; state: Exp; lines: +8 -0
+ Add new MiNT system calls: Tmalarm(), Psigintr(), Suptime().
+ All are unofficial and subject to change.
+ =============================================================================
+ ***** include/ostruct.h
+ ----------------------------
+ revision 43.2
+ date: 1994/02/22 17:47:58; author: entropy; state: Exp; lines: +4 -0
+ Complete the _PARAM structure used with Initmous().
+ =============================================================================
+ ***** cfgetisp.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:38:48; author: entropy; state: Exp;
+ NEW file, previously in cfspeed.c
+ =============================================================================
+ ***** cfgetosp.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:38:48; author: entropy; state: Exp;
+ NEW file, previously in cfspeed.c
+ =============================================================================
+ ***** cfsetisp.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:38:48; author: entropy; state: Exp;
+ NEW file, previously in cfspeed.c
+ =============================================================================
+ ***** cfsetosp.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:38:48; author: entropy; state: Exp;
+ NEW file, previously in cfspeed.c
+ =============================================================================
+ ***** closedir.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:41:04; author: entropy; state: Exp;
+ NEW file, broken out from dirent.c
+ =============================================================================
+ ***** do_lock.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:55:50; author: entropy; state: Exp;
+ NEW file, broken out from lockf.c
+ =============================================================================
+ ***** do_stat.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 14:42:02; author: entropy; state: Exp; lines: +2 -0
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:24:18; author: entropy; state: Exp;
+ NEW file, broken out from stat.c
+ =============================================================================
+ ***** dup.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +2 -26
+ broke out functions
+ =============================================================================
+ ***** dup2.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:42:52; author: entropy; state: Exp;
+ NEW file, broke out from dup.c
+ =============================================================================
+ ***** enoent.c
+ ----------------------------
+ revision 43.4
+ date: 1994/02/28 08:40:02; author: entropy; state: Exp; lines: +1 -1
+ Fix Fxattr() call (0 == follow links).
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 02:04:10; author: entropy; state: Exp; lines: +7 -1
+ block signals during critical portions of the code.
+ ----------------------------
+ revision 43.2
+ date: 1994/02/27 11:46:50; author: entropy; state: Exp;
+ NEW file: function to determine if an error should have been ENOENT
+ instead of ENOTDIR (UNIX and GEMDOS have different ideas on this).
+ =============================================================================
+ ***** execl.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:44:34; author: entropy; state: Exp;
+ NEW file, broken out from exec.c
+ =============================================================================
+ ***** execle.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:44:34; author: entropy; state: Exp;
+ NEW file, broken out from exec.c
+ =============================================================================
+ ***** execv.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:44:34; author: entropy; state: Exp;
+ NEW file, broken out from exec.c
+ =============================================================================
+ ***** execve.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:44:34; author: entropy; state: Exp;
+ NEW file, broken out from exec.c
+ =============================================================================
+ ***** flock.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:55:50; author: entropy; state: Exp;
+ NEW file, broken out from lockf.c
+ =============================================================================
+ ***** fscanf.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +0 -17
+ broke out functions
+ =============================================================================
+ ***** fstat.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 14:02:36; author: entropy; state: Exp; lines: +2 -0
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:24:18; author: entropy; state: Exp;
+ NEW file broken out from stat.c
+ =============================================================================
+ ***** getcwd.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +0 -13
+ broke out functions
+ =============================================================================
+ ***** getgroup.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 11:38:48; author: entropy; state: Exp; lines: +0 -26
+ Stripped out RCS header.
+ =============================================================================
+ ***** getwd.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 14:55:16; author: entropy; state: Exp; lines: +1 -0
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:50:12; author: entropy; state: Exp;
+ NEW file, broken out from getcwd.c
+ =============================================================================
+ ***** inode.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:24:18; author: entropy; state: Exp;
+ NEW file, broken out from stat.c
+ =============================================================================
+ ***** ioctl.c
+ ----------------------------
+ revision 43.4
+ date: 1994/02/21 19:20:52; author: entropy; state: Exp; lines: +62 -27
+ Add TIOCMGET (only works on /dev/modem1, requires MiNT 1.10
+ (needs valid st_rdev from FSTAT).
+ ----------------------------
+ revision 43.3
+ date: 1994/02/19 15:05:00; author: entropy; state: Exp; lines: +76 -57
+ Use switch instead of cascading if's.
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 14:41:50; author: entropy; state: Exp; lines: +24 -0
+ Add TIOCCDTR and TIOCSDTR.
+ =============================================================================
+ ***** isatty.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 15:00:50; author: entropy; state: Exp; lines: +1 -0
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +3 -44
+ broke out functions
+ =============================================================================
+ ***** isctty.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:55:16; author: entropy; state: Exp;
+ NEW file, broken out from isatty.c
+ =============================================================================
+ ***** lockf.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:36:30; author: entropy; state: Exp; lines: +3 -79
+ broke out functions
+ =============================================================================
+ ***** lstat.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 14:02:36; author: entropy; state: Exp; lines: +2 -0
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:24:18; author: entropy; state: Exp;
+ NEW file, broken out from stat.c
+ =============================================================================
+ ***** mincl
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 19:38:04; author: entropy; state: Exp; lines: +34 -18
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 02:00:32; author: entropy; state: Exp; lines: +1 -0
+ *** empty log message ***
+ =============================================================================
+ ***** open.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/27 14:08:02; author: entropy; state: Exp; lines: +1 -1
+ *** empty log message ***
+ ----------------------------
+ revision 43.2
+ date: 1994/02/27 12:04:08; author: entropy; state: Exp; lines: +3 -1
+ do _enoent() conversion.
+ =============================================================================
+ ***** opendir.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:41:04; author: entropy; state: Exp;
+ NEW file, broken out from dirent.c
+ =============================================================================
+ ***** readdir.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:41:04; author: entropy; state: Exp;
+ NEW file, broken out from dirent.c
+ =============================================================================
+ ***** rewinddi.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:41:04; author: entropy; state: Exp;
+ NEW file, broken out from dirent.c
+ =============================================================================
+ ***** scanf.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/24 16:44:30; author: schwab; state: Exp; lines: +6 -1
+ With the last change in scanf.c i have introduced a new bug: now
+ sscanf("0", "%x", &i) fails!
+ =============================================================================
+ ***** seekdir.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:41:04; author: entropy; state: Exp;
+ NEW file, broken out from dirent.c
+ =============================================================================
+ ***** stat.c
+ ----------------------------
+ revision 43.4
+ date: 1994/02/28 15:34:16; author: entropy; state: Exp; lines: +2 -0
+ *** empty log message ***
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 13:26:12; author: entropy; state: Exp; lines: +1 -326
+ broke out functions
+ ----------------------------
+ revision 43.2
+ date: 1994/02/27 11:51:00; author: entropy; state: Exp; lines: +3 -0
+ do _enoent() translation.
+ =============================================================================
+ ***** sync.c
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 02:19:50; author: entropy; state: Exp; lines: +1 -0
+ Include <string.h> for strcpy() prototype.
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 12:57:34; author: dsb; state: Exp; lines: +12 -6
+ Fix for sozobon compatibility.
+ =============================================================================
+ ***** tcdrain.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 13:07:18; author: entropy; state: Exp; lines: +22 -3
+ A better tcdrain() using TIOCOUTQ in MiNT 1.10.
+ =============================================================================
+ ***** tcflush.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 12:23:38; author: entropy; state: Exp; lines: +1 -1
+ Bug fix: specify the *address* of the bitmask of the type of flush,
+ not the bitmask itself.
+ =============================================================================
+ ***** telldir.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:41:04; author: entropy; state: Exp;
+ NEW file, broken out from dirent.c
+ =============================================================================
+ ***** unlink.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/27 11:56:12; author: entropy; state: Exp; lines: +2 -0
+ do _enoent() conversion.
+ =============================================================================
+ ***** vfscanf.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:48:16; author: entropy; state: Exp;
+ NEW file, broken out from fscanf.c
+ =============================================================================
+ ***** vscanf.c
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 13:48:16; author: entropy; state: Exp;
+ NEW file, broken out from fscanf.c
+ =============================================================================
+ ***** purec/Makefile
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 17:59:16; author: entropy; state: Exp; lines: +32 -18
+ Add new targets.
+ =============================================================================
+ ***** purec/mintlib.prj
+ ----------------------------
+ revision 43.2
+ date: 1994/02/28 18:13:42; author: entropy; state: Exp; lines: +46 -3
+ Add new targets.
+ =============================================================================
+ ***** sozobon/makefile
+ ----------------------------
+ revision 43.3
+ date: 1994/02/28 17:41:18; author: entropy; state: Exp; lines: +45 -32
+ add new targets
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 12:58:24; author: dsb; state: Exp; lines: +28 -13
+ Updated for PL43.
+ =============================================================================
+ ***** sozobon/readme
+ ----------------------------
+ revision 43.2
+ date: 1994/02/19 12:58:44; author: dsb; state: Exp; lines: +7 -10
+ Updated for PL43.
+ =============================================================================
+
PATCHLEVEL43::
***** libgcc2.c
*** 43.1 1994/02/15 19:34:32
--- Files 1994/02/28 13:22:14
***************
*** 6,59 ****
_mulsf3.cpp _mulsi3.s _negdf2.s _negsf2.s _normdf.cpp \
_normsf.cpp _truncdf.cpp _udivmod.s _umulsi3.s a64l.c \
abort.c abs.c access.c alglobal.c alloca.cpp \
! alphasor.c atof.c atol.c bblink.c bcmp.c \
! bcopy.cpp binmode.c bsearch.c buffindf.c bzero.cpp \
! calloc.c chdir.c chmod.c ctermid.c ctime.c \
! ctype.c cuserid.c defmode.c difftime.c div.c \
! div.cpp doprnt.c eprintf.c errbase.h fclose.c \
! fdopen.c fflush.c ffs.c fgetc.c fgets.c \
! filbuf.c findfile.c flonum.h fopen.c fprintf.c \
! fputc.c fputs.c fread.c frexp.cpp frwbin.c \
! fseek.c fsetpos.c ftw.c fungetc.c fwrite.c \
! gbl-ctors.h getbuf.c getenv.c getlogin.c getopt.c \
! getpass.c getpid.c getpw.c gets.c getuid.c \
getw.c gmon.c gnulib2.c grp.c ic.c \
! ig.c il.c ip.c iw.c ldexp.cpp \
! lib.h libgcc1.c libgcc2.c linea.c localtim.c \
! longlong.h lseek.c ltoa.c malloc.c memccpy.c \
! memchr.c memcmp.c mktemp.c modf.cpp nlist.c \
! obstack.c perror.c pgrp.c printf.c psignal.c \
! putenv.c qsort.c raise.c rand.c random.c \
! realloc.c regexp.c regsup.c sbrk.c setbuf.c \
! setjmp.cpp setlocal.c setvbuf.c sgtty.c siglist.c \
! sprintf.c stksiz.c strcat.c strchr.c strcmp.c \
! strcoll.c strcpy.c strcspn.c strdup.c strerror.c \
! strftime.c stricmp.c strlen.c strlwr.c strncat.c \
! strncmp.c strncpy.c strnicmp.c strpbrk.c strrchr.c \
! strrev.c strspn.c strstr.c strtok.c strtol.c \
! strtoul.c strupr.c system.c sysvar.c textio.c \
! time.c timeoday.c tmpfile.c tmpnam.c toxxx.c \
! utime.c vfprintf.c vprintf.c wcmb.c wcscat.c \
! wcscmp.c wcscpy.c wcslen.c wnull.c \
MINTLIB= \
! Makefile alarm.c atexit.c cfspeed.c clock.c \
! close.c console.c crt0.cpp crtinit.c dirent.c \
! dup.c exec.c execp.c fcntl.c fopenp.c \
! fork.c fscanf.c getcwd.c getdtabl.c getgroup.c \
! gethostn.c getpages.c getrusag.c heapbase.c ident.c \
! inistack.c initsig.c ioctl.c isatty.c kill.c \
! killpg.c link.c lockf.c main.c mincl \
! mkdir.c mkfifo.c mknod.c nice.c open.c \
! osbind.cpp pause.c pipe.c popen.c putpwent.c \
! read.c rename.c rmdir.c scandir.c scanf.c \
select.c setrlimi.c sigactio.c sigblock.c signal.c \
sleep.c spawn.c spawnve.c spawnvp.c sscanf.c \
stat.c statfs.c symlink.c sync.c sysconf.c \
tcattr.c tcbreak.c tcdrain.c tcflow.c tcflush.c \
! tcpgrp.c thread.c times.c truncate.c ttyname.c \
! uname.c unlink.c unx2dos.c utmp.c vfork.cpp \
! wait.c wait3.c waitpid.c write.c wtmp.c \
MINTLIB_NOCL= \
AUTHORS Bugs Changelog Copyright Files \
--- 6,69 ----
_mulsf3.cpp _mulsi3.s _negdf2.s _negsf2.s _normdf.cpp \
_normsf.cpp _truncdf.cpp _udivmod.s _umulsi3.s a64l.c \
abort.c abs.c access.c alglobal.c alloca.cpp \
! alphasor.c atof.c atoi.c atol.c bblink.c \
! bcmp.c bcopy.cpp binmode.c bsearch.c buffindf.c \
! bzero.cpp calloc.c chdir.c chmod.c chown.c \
! ctermid.c ctime.c ctype.c cuserid.c defmode.c \
! difftime.c div.c div.cpp doprnt.c eprintf.c \
! errbase.h fclose.c fdopen.c fflush.c ffs.c \
! fgetc.c fgetpos.c fgets.c filbuf.c findfile.c \
! flonum.h fopen.c fopen_i.c fprintf.c fputc.c \
! fputs.c fread.c freopen.c frexp.cpp frwbin.c \
! fseek.c fsetpos.c ftell.c ftw.c fungetc.c \
! fwrite.c gbl-ctors.h getbuf.c getegid.c getenv.c \
! geteuid.c getgid.c getlogin.c getopt.c getpass.c \
! getpid.c getppid.c getpw.c gets.c getuid.c \
getw.c gmon.c gnulib2.c grp.c ic.c \
! ig.c il.c ip.c iw.c l64a.c \
! labs.c ldexp.cpp ldiv.c lib.h libgcc1.c \
! libgcc2.c linea.c localtim.c longlong.h lseek.c \
! ltoa.c malloc.c memccpy.c memchr.c memcmp.c \
! mktemp.c modf.cpp nlist.c obstack.c perror.c \
! pgrp.c printf.c psignal.c putenv.c puts.c \
! qsort.c raise.c rand.c random.c realloc.c \
! regexp.c regsup.c rewind.c sbrk.c setbuf.c \
! setegid.c seteuid.c setgid.c setjmp.cpp setlocal.c \
! setregid.c setreuid.c setuid.c setvbuf.c sgtty.c \
! siglist.c sprintf.c stksiz.c strcat.c strchr.c \
! strcmp.c strcoll.c strcpy.c strcspn.c strdup.c \
! strerror.c strftime.c stricmp.c strlen.c strlwr.c \
! strncat.c strncmp.c strncpy.c strnicmp.c strpbrk.c \
! strrchr.c strrev.c strspn.c strstr.c strtok.c \
! strtol.c strtoul.c strupr.c system.c sysvar.c \
! textio.c time.c timeoday.c tmpfile.c tmpnam.c \
! toxxx.c uidgid.c utime.c vfprintf.c vprintf.c \
! wcmb.c wcscat.c wcscmp.c wcscpy.c wcslen.c \
! wnull.c \
MINTLIB= \
! Makefile alarm.c atexit.c cfgetisp.c cfgetosp.c \
! cfsetisp.c cfsetosp.c clock.c close.c closedir.c \
! console.c crt0.cpp crtinit.c do_lock.c do_stat.c \
! dup.c dup2.c enoent.c execl.c execle.c \
! execp.c execv.c execve.c fcntl.c flock.c \
! fopenp.c fork.c fscanf.c fstat.c getcwd.c \
! getdtabl.c getgroup.c gethostn.c getpages.c getrusag.c \
! getwd.c heapbase.c ident.c inistack.c initsig.c \
! inode.c ioctl.c isatty.c isctty.c kill.c \
! killpg.c link.c lockf.c lstat.c main.c \
! mincl mkdir.c mkfifo.c mknod.c nice.c \
! open.c opendir.c osbind.cpp pause.c pipe.c \
! popen.c putpwent.c read.c readdir.c rename.c \
! rewinddi.c rmdir.c scandir.c scanf.c seekdir.c \
select.c setrlimi.c sigactio.c sigblock.c signal.c \
sleep.c spawn.c spawnve.c spawnvp.c sscanf.c \
stat.c statfs.c symlink.c sync.c sysconf.c \
tcattr.c tcbreak.c tcdrain.c tcflow.c tcflush.c \
! tcpgrp.c telldir.c thread.c times.c truncate.c \
! ttyname.c uname.c unlink.c unx2dos.c utmp.c \
! vfork.cpp vfscanf.c vscanf.c wait.c wait3.c \
! waitpid.c write.c wtmp.c \
MINTLIB_NOCL= \
AUTHORS Bugs Changelog Copyright Files \
*** 43.1 1994/02/15 19:34:32
--- Makefile.adm 1994/02/28 18:54:30
***************
*** 100,107 ****
$(srcdir)/sozobon $(incdir) $(incdir)/sys ;\
do \
cd $$dir ;\
! ci -l -f -m- -r$V.1 RCS/* ;\
! co -f -l RCS/* ;\
done
echo '/*' > PatchLev.h
echo ' * This identifies the version of the MiNT library in this' >> PatchLev.h
--- 100,106 ----
$(srcdir)/sozobon $(incdir) $(incdir)/sys ;\
do \
cd $$dir ;\
! ci -l$V.1 -f -m- RCS/* ;\
done
echo '/*' > PatchLev.h
echo ' * This identifies the version of the MiNT library in this' >> PatchLev.h
***************
*** 115,117 ****
--- 114,127 ----
ci -f -l -m- Version
ci -f -l -m- PatchLev.h
cd $(incdir) ; ci -f -l -m- PatchLev.h
+
+ checkrcs:
+ make -f Makefile distclean
+ for dir in $(srcdir) $(srcdir)/crlf $(srcdir)/lattice \
+ $(srcdir)/purec $(srcdir)/purec/unixname \
+ $(srcdir)/sozobon $(incdir) $(incdir)/sys ;\
+ do \
+ cd $$dir ;\
+ echo $$dir ;\
+ rcsdiff -u * ;\
+ done | less
*** 43.1 1994/02/15 19:34:32
--- PatchLev.h 1994/02/15 20:33:26
***************
*** 3,6 ****
* directory.
*/
! #define PatchLevel "43"
--- 3,6 ----
* directory.
*/
! #define PatchLevel "44"
*** 43.1 1994/02/15 19:34:32
--- README 1994/02/28 18:22:48
***************
*** 74,87 ****
As of Patchlevel 31, the MiNT library no longer supports any version of
GCC before 2.0.
! The MiNT library cannot be built on a TOS filesystem, due to name conflicts
! between several modules (for example, _udivmod.o and _udivmoddi4.o). It
! should work on a cross-compiler or an ST with a filesystem such as minixfs.
My configuration, used to build the library on an extended filename
! V2 minixfs with gcc 2.3.1:
/mint/bin/mfsconf F: -s n -d n -x t -l n
! UNIXMODE=cu/rUx
Special thanks go out to Jeff Weiner and the rest of the umich archive posse
for letting me use terminator for the maintenance of the library.
--- 74,88 ----
As of Patchlevel 31, the MiNT library no longer supports any version of
GCC before 2.0.
! The GCC version of the MiNT library cannot be built on a TOS filesystem, due
! to name conflicts between several modules (for example, _udivmod.o and
! _udivmoddi4.o). It should work on a cross-compiler or an ST with a
! filesystem such as minixfs.
My configuration, used to build the library on an extended filename
! V2 minixfs with gcc 2.4.5:
/mint/bin/mfsconf F: -s n -d n -x t -l n
! UNIXMODE=bcu/rUxs
Special thanks go out to Jeff Weiner and the rest of the umich archive posse
for letting me use terminator for the maintenance of the library.
*** 43.1 1994/02/15 19:34:32
--- Version 1994/02/15 20:33:32
***************
*** 1 ****
! V=43
--- 1 ----
! V=44
*** /dev/null Mon Feb 28 07:43:04 1994
--- cfgetisp.c Mon Feb 28 04:42:44 1994
***************
*** 0 ****
--- 1,14 ----
+ /*
+ Public domain termios cfgetispeed() for the MiNT library
+ 10 October 1993 entropy@terminator.rs.itd.umich.edu -- first attempt
+ */
+
+ #include <types.h>
+ #include <termios.h>
+
+ speed_t
+ cfgetispeed(stp)
+ const struct termios *stp;
+ {
+ return stp->_c_ispeed;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- cfgetosp.c Mon Feb 28 04:45:02 1994
***************
*** 0 ****
--- 1,15 ----
+ /*
+ Public domain termios cfgetospeed() for the MiNT library
+ 10 October 1993 entropy@terminator.rs.itd.umich.edu -- first attempt
+ */
+
+ #include <types.h>
+ #include <termios.h>
+
+ speed_t
+ cfgetospeed(stp)
+ const struct termios *stp;
+ {
+ return stp->_c_ospeed;
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- cfsetisp.c Mon Feb 28 04:46:00 1994
***************
*** 0 ****
--- 1,17 ----
+ /*
+ Public domain termios cfsetispeed() for the MiNT library
+ 10 October 1993 entropy@terminator.rs.itd.umich.edu -- first attempt
+ */
+
+ #include <types.h>
+ #include <termios.h>
+
+ int
+ cfsetispeed(stp, baudcode)
+ struct termios *stp;
+ speed_t baudcode;
+ {
+ stp->_c_ispeed = baudcode;
+ return 0;
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- cfsetosp.c Mon Feb 28 04:47:34 1994
***************
*** 0 ****
--- 1,17 ----
+ /*
+ Public domain termios cfsetospeed() for the MiNT library
+ 10 October 1993 entropy@terminator.rs.itd.umich.edu -- first attempt
+ */
+
+ #include <types.h>
+ #include <termios.h>
+
+ int
+ cfsetospeed(stp, baudcode)
+ struct termios *stp;
+ speed_t baudcode;
+ {
+ stp->_c_ospeed = baudcode;
+ return 0;
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- closedir.c Mon Feb 28 05:00:18 1994
***************
*** 0 ****
--- 1,35 ----
+ /* closedir routine */
+
+ /* under MiNT (v0.9 or better) these use the appropriate system calls.
+ * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
+ *
+ * Written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <types.h>
+ #include <limits.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include "lib.h"
+
+ extern int __mint;
+ extern ino_t __inode; /* in stat.c */
+
+ int
+ closedir(dirp)
+ DIR *dirp;
+ {
+ int r;
+
+ if (__mint > 8) {
+ r = (int)Dclosedir(dirp->handle);
+ } else {
+ r = 0;
+ }
+ free(dirp);
+ return r;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- do_lock.c Mon Feb 28 07:25:28 1994
***************
*** 0 ****
--- 1,61 ----
+ /*
+ * lockf(3) and flock(2) emulation for MiNT by Dave Gymer
+ * Placed in the public domain; do with me as you will!
+ */
+
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <mintbind.h>
+ #include <file.h>
+ #include "lib.h"
+
+ int
+ _do_lock(fd, cmd, size, whence)
+ int fd;
+ int cmd;
+ long size;
+ int whence;
+ {
+ struct flock lock;
+ int fcmd;
+ long r;
+ extern int __mint;
+
+ if (!__mint) {
+ errno = -EINVAL;
+ return -1;
+ }
+ lock.l_whence = whence;
+ lock.l_start = 0;
+ lock.l_len = size;
+ switch (cmd) {
+ case F_ULOCK:
+ lock.l_type = F_UNLCK;
+ fcmd = F_SETLK;
+ break;
+ case F_TEST:
+ lock.l_type = F_WRLCK;
+ fcmd = F_GETLK;
+ break;
+ case F_TLOCK:
+ lock.l_type = F_WRLCK;
+ fcmd = F_SETLK;
+ break;
+ case F_LOCK:
+ lock.l_type = F_WRLCK;
+ if (__mint < 95)
+ fcmd = F_SETLK;
+ else
+ fcmd = F_SETLKW;
+ break;
+ default:
+ errno = -EINVAL;
+ return -1;
+ }
+ if ((r = Fcntl(fd, &lock, fcmd)) < 0) {
+ errno = (int) -r;
+ return -1;
+ }
+ return 0;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- do_stat.c Mon Feb 28 09:41:46 1994
***************
*** 0 ****
--- 1,232 ----
+ /*
+ * stat, fstat, lstat emulation for TOS
+ * written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <limits.h>
+ #include <types.h>
+ #include <stat.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
+ #include <support.h>
+ #include <ioctl.h> /* for FSTAT */
+ #include "lib.h"
+
+ extern int __mint;
+
+ extern ino_t __inode;
+
+ /* for backwards compatibilty: if nonzero, files are checked to see if
+ * they have the TOS executable magic number in them
+ */
+
+ int _x_Bit_set_in_stat = 0;
+
+ /* date for files (like root directories) that don't have one */
+ #define OLDDATE _unixtime(0,0)
+
+ /*
+ * common routine for stat() and lstat(); if "lflag" is 0, then symbolic
+ * links are automatically followed (like stat), if 1 then they are not
+ * (like lstat)
+ */
+
+ __EXTERN int _do_stat __PROTO((const char *_path, struct stat *st, int lflag));
+
+ int
+ _do_stat(_path, st, lflag)
+ const char *_path;
+ struct stat *st;
+ int lflag;
+ {
+ long r;
+ _DTA *olddta;
+ int nval;
+ char path[PATH_MAX];
+ char *ext, drv;
+ int fd;
+ short magic;
+ _DTA d;
+ int isdot = 0;
+
+ if (!_path) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ /*
+ * _unx2dos returns 1 for device names (like /dev/con)
+ */
+ nval = _unx2dos(_path, path);
+
+ /* for MiNT 0.9 and up, we use the built in stat() call */
+ if (__mint >= 9) {
+ r = Fxattr(lflag, path, st);
+ if (r) {
+ if ((r == -EPATH) && _enoent(path)) {
+ r = -ENOENT;
+ }
+ errno = (int) -r;
+ return -1;
+ }
+ __UNIXTIME(st->st_mtime);
+ __UNIXTIME(st->st_atime);
+ __UNIXTIME(st->st_ctime);
+ /* Most versions of Unix count in 512 byte blocks */
+ st->st_blocks = (st->st_blocks * st->st_blksize) / 512;
+ /* if we hit a symbolic link, try to get its size right */
+ if (lflag && ((st->st_mode & S_IFMT) == S_IFLNK)) {
+ char buf[PATH_MAX + 1];
+ char buf1[PATH_MAX + 1];
+ r = Freadlink(PATH_MAX, buf, path);
+ if (r < 0)
+ {
+ errno = (int) -r;
+ return -1;
+ }
+ buf[PATH_MAX] = 0;
+ _dos2unx (buf, buf1);
+ st->st_size = strlen (buf1);
+ }
+ return 0;
+ }
+
+ /* otherwise, check to see if we have a name like CON: or AUX: */
+ if (nval == 1) {
+ st->st_mode = S_IFCHR | 0600;
+ st->st_attr = 0;
+ st->st_ino = ++__inode;
+ st->st_rdev = 0;
+ st->st_mtime = st->st_ctime = st->st_atime =
+ time((time_t *)0) - 2;
+ st->st_dev = 0;
+ st->st_nlink = 1;
+ st->st_uid = geteuid();
+ st->st_gid = getegid();
+ st->st_size = st->st_blocks = 0;
+ st->st_blksize = 1024;
+ return 0;
+ }
+
+ /* A file name: check for root directory of a drive */
+ if (path[0] == '\\' && path[1] == 0) {
+ drv = Dgetdrv() + 'A';
+ goto rootdir;
+ }
+
+ if ( ((drv = path[0]) != 0) && path[1] == ':' &&
+ (path[2] == 0 || (path[2] == '\\' && path[3] == 0)) ) {
+ rootdir:
+ st->st_mode = S_IFDIR | 0755;
+ st->st_attr = FA_DIR;
+ st->st_dev = isupper(drv) ? drv - 'A' : drv - 'a';
+ st->st_ino = 2;
+ st->st_mtime = st->st_ctime = st->st_atime = OLDDATE;
+ goto fill_dir;
+ }
+
+ /* forbid wildcards in path names */
+ if (index(path, '*') || index(path, '?')) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* OK, here we're going to have to do an Fsfirst to get the date */
+ /* NOTE: Fsfirst(".",-1) or Fsfirst("..",-1) both fail under TOS,
+ * so we kludge around this by using the fact that Fsfirst(".\*.*"
+ * or "..\*.*" will return the correct file first (except, of course,
+ * in root directories :-( ).
+ * NOTE2: Some versions of TOS don't like Fsfirst("RCS\\", -1) either,
+ * so we do the same thing if the path ends in '\\'.
+ */
+
+ /* find the end of the string */
+ for (ext = path; ext[0] && ext[1]; ext++) ;
+
+ /* add appropriate kludge if necessary */
+ if (*ext == '.' && (ext == path || ext[-1] == '\\' || ext[-1] == '.')) {
+ isdot = 1;
+ strcat(path, "\\*.*");
+ } else if (*ext == '\\') {
+ isdot = 1;
+ strcat(path, "*.*");
+ }
+ olddta = Fgetdta();
+ Fsetdta(&d);
+ r = Fsfirst(path, 0xff);
+ Fsetdta(olddta);
+ if (r < 0) {
+ if (isdot && r == -ENOENT) goto rootdir;
+ errno = (int) -r;
+ return -1;
+ }
+
+ if (isdot && ((d.dta_name[0] != '.') || (d.dta_name[1]))) {
+ goto rootdir;
+ }
+
+ st->st_mtime = st->st_ctime = st->st_atime =
+ _unixtime(d.dta_time, d.dta_date);
+ if (((drv = *path) != 0) && path[1] == ':')
+ st->st_dev = toupper(drv) - 'A';
+ else
+ st->st_dev = Dgetdrv();
+
+ st->st_ino = __inode++;
+ st->st_attr = d.dta_attribute;
+ if (__mint && st->st_dev == ('Q' - 'A'))
+ st->st_mode = 0644 | S_IFIFO;
+ else {
+ st->st_mode = 0644 | (st->st_attr & FA_DIR ?
+ S_IFDIR | 0111 : S_IFREG);
+ }
+
+ if (st->st_attr & FA_RDONLY)
+ st->st_mode &= ~0222; /* no write permission */
+ if (st->st_attr & FA_HIDDEN)
+ st->st_mode &= ~0444; /* no read permission */
+
+ /* check for a file with an executable extension */
+ ext = strrchr(_path, '.');
+ if (ext) {
+ if (!strcmp(ext, ".ttp") || !strcmp(ext, ".prg") ||
+ !strcmp(ext, ".tos") || !strcmp(ext, ".g") ||
+ !strcmp(ext, ".sh") || !strcmp(ext, ".bat")) {
+ st->st_mode |= 0111;
+ }
+ }
+ if ( (st->st_mode & S_IFMT) == S_IFREG) {
+ if (_x_Bit_set_in_stat) {
+ if ((fd = (int) Fopen(path,0)) < 0) {
+ errno = -fd;
+ return -1;
+ }
+ magic = 0;
+ (void)Fread(fd,2,(char *)&magic);
+ (void)Fclose(fd);
+ if (magic == 0x601A /* TOS executable */
+ || magic == 0x2321) /* "#!" shell file */
+ st->st_mode |= 0111;
+ }
+ st->st_size = d.dta_size;
+ /* in Unix, blocks are measured in 512 bytes */
+ st->st_blocks = (st->st_size + 511) / 512;
+ st->st_nlink = 1; /* we dont have hard links */
+ } else {
+ fill_dir:
+ st->st_size = 1024;
+ st->st_blocks = 2;
+ st->st_nlink = 2; /* "foo" && "foo/.." */
+ }
+
+ st->st_rdev = 0;
+ st->st_uid = geteuid(); /* the current user owns every file */
+ st->st_gid = getegid();
+ st->st_blksize = 1024;
+ return 0;
+ }
*** 43.1 1994/02/15 19:34:32
--- dup.c 1994/02/28 10:16:02
***************
*** 1,11 ****
/* from Dale Schumacher's dLibs library */
! /* these will have to be adjusted at some time ++jrb */
! /* use these with caution, TOS 1.4 still has double re-direction bug! */
#include <stddef.h>
#include <fcntl.h>
- #include <osbind.h>
#include <errno.h>
#include <mintbind.h>
#include <unistd.h>
--- 1,10 ----
/* from Dale Schumacher's dLibs library */
! /* will have to be adjusted at some time ++jrb */
! /* use with caution, TOS 1.4 still has double re-direction bug! */
#include <stddef.h>
#include <fcntl.h>
#include <errno.h>
#include <mintbind.h>
#include <unistd.h>
***************
*** 43,68 ****
return(rv);
}
- int
- dup2(handle1, handle2)
- int handle1, handle2;
- {
- int rv;
- long flags;
-
- if (handle1 == handle2)
- return (handle2);
-
- if ((rv = (int)Fforce(handle2, handle1)) < 0)
- errno = -rv;
- else {
- if (__OPEN_INDEX(handle2) < __NHANDLES)
- __open_stat[__OPEN_INDEX(handle2)] =
- __open_stat[__OPEN_INDEX(handle1)];
- if (__mint) {
- flags = (long)Fcntl(handle2, (long)0, F_GETFD);
- (void)Fcntl(handle2, flags & ~FD_CLOEXEC, F_SETFD);
- }
- }
- return (rv < 0) ? -1 : handle2;
- }
--- 42,44 ----
*** /dev/null Mon Feb 28 07:43:04 1994
--- dup2.c Mon Feb 28 05:15:16 1994
***************
*** 0 ****
--- 1,37 ----
+ /* from Dale Schumacher's dLibs library */
+
+ /* will have to be adjusted at some time ++jrb */
+ /* use with caution, TOS 1.4 still has double re-direction bug! */
+
+ #include <stddef.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <mintbind.h>
+ #include <unistd.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ int
+ dup2(handle1, handle2)
+ int handle1, handle2;
+ {
+ int rv;
+ long flags;
+
+ if (handle1 == handle2)
+ return (handle2);
+
+ if ((rv = (int)Fforce(handle2, handle1)) < 0)
+ errno = -rv;
+ else {
+ if (__OPEN_INDEX(handle2) < __NHANDLES)
+ __open_stat[__OPEN_INDEX(handle2)] =
+ __open_stat[__OPEN_INDEX(handle1)];
+ if (__mint) {
+ flags = (long)Fcntl(handle2, (long)0, F_GETFD);
+ (void)Fcntl(handle2, flags & ~FD_CLOEXEC, F_SETFD);
+ }
+ }
+ return (rv < 0) ? -1 : handle2;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- enoent.c Mon Feb 28 03:39:32 1994
***************
*** 0 ****
--- 1,46 ----
+ #include <errno.h>
+ #include <string.h>
+ #include <stat.h>
+ #include <mintbind.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ /*
+ Given a pathname for which some system call returned EPATH, this function
+ decides if UNIX would have returned ENOENT instead.
+ Warning: path must be in dos format.
+ */
+
+ int
+ _enoent(path)
+ char *path;
+ {
+ register char *s;
+ struct stat st;
+ long oldmask;
+
+ if (__mint < 9)
+ {
+ return 0; /* don't bother... */
+ }
+ for (s = path; *s; s++)
+ /* nop */;
+ oldmask = Psigblock(~0L);
+ for ( ; s != path; s--)
+ {
+ if (*s == '\\')
+ {
+ *s = '\0';
+ if ((Fxattr(0, path, &st) == 0) && ((st.st_mode & S_IFMT) != S_IFDIR))
+ {
+ *s = '\\';
+ (void) Psigsetmask(oldmask);
+ return 0; /* existing non-directory file in path, ENOTDIR ok */
+ }
+ *s = '\\';
+ }
+ }
+ (void) Psigsetmask(oldmask);
+ return 1; /* should have been ENOENT */
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- execl.c Mon Feb 28 05:26:44 1994
***************
*** 0 ****
--- 1,21 ----
+ /*
+ execl for MiNT/TOS; written by Eric R. Smith, and
+ placed in the public domain
+ */
+
+ #include <stdarg.h>
+ #include <process.h>
+ #include <unistd.h>
+
+ #ifdef __STDC__
+ int execl(const char *path, ...)
+ #else
+ int execl(path)
+ char *path;
+ #endif
+ {
+ va_list args;
+
+ va_start(args, path);
+ return _spawnve(P_OVERLAY, path, (char **)args, NULL);
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- execle.c Mon Feb 28 05:26:36 1994
***************
*** 0 ****
--- 1,25 ----
+ /*
+ execle for MiNT/TOS; written by Eric R. Smith, and
+ placed in the public domain
+ */
+
+ #include <stdarg.h>
+ #include <process.h>
+ #include <unistd.h>
+
+ #ifdef __STDC__
+ int execle(const char *path, ...)
+ #else
+ int execle(path)
+ char *path;
+ #endif
+ {
+ va_list args;
+ char ***envp;
+
+ va_start(args, path);
+
+ for (envp = (char ***) args ; *envp ; envp++)
+ ;
+ return _spawnve(P_OVERLAY, path, (char **)args, *(envp+1));
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- execv.c Mon Feb 28 05:21:58 1994
***************
*** 0 ****
--- 1,16 ----
+ /*
+ execv for MiNT/TOS; written by Eric R. Smith, and
+ placed in the public domain
+ */
+
+ #include <process.h>
+ #include <unistd.h>
+
+ int
+ execv(path, argv)
+ const char *path;
+ char *const *argv;
+ {
+ return _spawnve(P_OVERLAY, path, argv, NULL);
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- execve.c Mon Feb 28 05:20:04 1994
***************
*** 0 ****
--- 1,17 ----
+ /*
+ execve for MiNT/TOS; written by Eric R. Smith, and
+ placed in the public domain
+ */
+
+ #include <process.h>
+ #include <unistd.h>
+
+ int
+ execve(path, argv, envp)
+ const char *path;
+ char *const *argv;
+ char *const *envp;
+ {
+ return _spawnve(P_OVERLAY, path, argv, envp);
+ }
+
*** /dev/null Mon Feb 28 07:43:04 1994
--- flock.c Mon Feb 28 07:31:06 1994
***************
*** 0 ****
--- 1,27 ----
+ /*
+ * lockf(3) and flock(2) emulation for MiNT by Dave Gymer
+ * Placed in the public domain; do with me as you will!
+ */
+
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <file.h>
+ #include "lib.h"
+
+ int
+ flock(fd, op)
+ int fd, op;
+ {
+ int cmd;
+
+ if (op & (LOCK_SH | LOCK_EX))
+ cmd = (op & LOCK_NB) ? F_TLOCK : F_LOCK;
+ else if (op & LOCK_UN)
+ cmd = F_ULOCK;
+ else {
+ errno = -EINVAL;
+ return -1;
+ }
+ return _do_lock(fd, cmd, 0L, 0);
+ }
*** 43.1 1994/02/15 19:34:32
--- fscanf.c 1994/02/28 11:20:14
***************
*** 46,65 ****
return(_scanf(stdin, fgetc, fungetc, fmt, &arg));
}
#endif /* __STDC__ */
-
- int
- vscanf(fmt, arg)
- const char *fmt;
- va_list arg;
- {
- return(_scanf(stdin, fgetc, fungetc, fmt, arg));
- }
-
- int
- vfscanf(fp, fmt, arg)
- FILE *fp;
- const char *fmt;
- va_list arg;
- {
- return(_scanf(fp, fgetc, fungetc, fmt, arg));
- }
--- 46,48 ----
*** /dev/null Mon Feb 28 07:43:04 1994
--- fstat.c Mon Feb 28 09:01:58 1994
***************
*** 0 ****
--- 1,96 ----
+ #include <limits.h>
+ #include <types.h>
+ #include <stat.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
+ #include <support.h>
+ #include <ioctl.h> /* for FSTAT */
+ #include "lib.h"
+
+ extern int __mint;
+
+ extern ino_t __inode;
+
+ __EXTERN int _do_stat __PROTO((const char *_path, struct stat *st, int lflag));
+
+ /*
+ * fstat: if we're not running under MiNT, this is pretty bogus.
+ * what we can really find is:
+ * modification time: via Fdatime()
+ * file size: via Fseek()
+ * fortunately, these are the things most programs are interested in.
+ * BUG: passing an invalid file descriptor gets back a stat structure for
+ * a tty.
+ */
+
+ int
+ fstat(fd, st)
+ int fd;
+ struct stat *st;
+ {
+ long oldplace, r;
+ _DOSTIME timeptr;
+ short magic;
+
+ if (__mint >= 9) { /* use FSTAT Fcntl */
+ r = Fcntl(fd, (long)st, FSTAT);
+ if (r) {
+ errno = (int) -r;
+ return -1;
+ }
+ __UNIXTIME(st->st_mtime);
+ __UNIXTIME(st->st_atime);
+ __UNIXTIME(st->st_ctime);
+ st->st_blocks = (st->st_blocks * st->st_blksize) / 512;
+ return 0;
+ }
+
+ r = Fdatime(&timeptr, fd, 0);
+ if (r < 0) { /* assume TTY */
+ st->st_mode = S_IFCHR | 0600;
+ st->st_attr = 0;
+ st->st_mtime = st->st_ctime = st->st_atime =
+ time((time_t *)0) - 2;
+ st->st_size = 0;
+ } else {
+ st->st_mtime = st->st_atime = st->st_ctime =
+ _unixtime(timeptr.time, timeptr.date);
+ st->st_mode = S_IFREG | 0644; /* this may be false */
+ st->st_attr = 0; /* because this is */
+
+ /* get current file location */
+ oldplace = Fseek(0L, fd, SEEK_CUR);
+ if (oldplace < 0) { /* can't seek -- must be pipe */
+ st->st_mode = S_IFIFO | 0644;
+ st->st_size = 1024;
+ } else {
+ r = Fseek(0L, fd, SEEK_END); /* go to end of file */
+ st->st_size = r;
+ (void)Fseek(0L, fd, SEEK_SET); /* go to start of file */
+ /* check for executable file */
+ if (Fread(fd, 2, (char *)&magic) == 2) {
+ if (magic == 0x601a || magic == 0x2321)
+ st->st_mode |= 0111;
+ }
+ (void)Fseek(oldplace, fd, SEEK_SET);
+ }
+ }
+
+ /* all this stuff is likely bogus as well. sigh. */
+ st->st_dev = Dgetdrv();
+ st->st_rdev = 0;
+ st->st_uid = getuid();
+ st->st_gid = getgid();
+ st->st_blksize = 1024;
+ /* note: most Unixes measure st_blocks in 512 byte units */
+ st->st_blocks = (st->st_size + 511) / 512;
+ st->st_ino = ++__inode;
+ st->st_nlink = 1;
+ return 0;
+ }
+
*** 43.1 1994/02/15 19:34:32
--- getcwd.c 1994/02/28 11:36:12
***************
*** 60,75 ****
return buf;
}
- /*
- * char *getwd(char *buf)
- * return cwd in buf
- */
- char *getwd(buf)
- char *buf;
- {
- char *ret = getcwd(buf, PATH_MAX);
- if (ret)
- return ret;
- strcpy (buf, strerror (errno));
- return NULL;
- }
--- 60,62 ----
*** /dev/null Mon Feb 28 07:43:04 1994
--- getwd.c Mon Feb 28 09:54:48 1994
***************
*** 0 ****
--- 1,20 ----
+ #include <limits.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include "lib.h"
+
+ /*
+ * char *getwd(char *buf)
+ * return cwd in buf
+ */
+ char *
+ getwd(buf)
+ char *buf;
+ {
+ char *ret = getcwd(buf, PATH_MAX);
+ if (ret)
+ return ret;
+ strcpy(buf, strerror(errno));
+ return NULL;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- inode.c Mon Feb 28 04:22:50 1994
***************
*** 0 ****
--- 1,4 ----
+ #include <types.h>
+
+ ino_t __inode = 32; /* used in readdir, _do_stat, fstat */
+
*** 43.1 1994/02/15 19:34:32
--- ioctl.c 1994/02/21 19:16:42
***************
*** 10,15 ****
--- 10,16 ----
#include <unistd.h>
#include <linea.h> /* for TIOCGWINSZ under TOS */
#include <support.h>
+ #include <stat.h>
#include "lib.h" /* for __open_stat */
extern int __mint; /* MiNT version */
***************
*** 28,86 ****
int istty = isatty(fd);
struct sgttyb *sg = (struct sgttyb *) arg;
int null_fd;
if (istty) {
! if (cmd == TIOCGETD) {
*((int *)arg) = _ttydisc;
return 0;
! } else if (cmd == TIOCSETD) {
_ttydisc = *((int *)arg);
return 0;
! } else if (cmd == TIOCLGET) {
*((int *)arg) = _ldisc;
return 0;
! } else if (cmd == TIOCLSET) {
_ldisc = *((int *)arg);
return 0;
! } else if (cmd == TIOCSWINSZ && __mint < 9) {
! return 0;
! } else if (cmd == TIOCGWINSZ && __mint < 9) {
! struct winsize *win = (struct winsize *)arg;
!
#ifndef __SOZOBON__
! (void)linea0();
#else /* __SOZOBON__ */
! linea0();
#endif /* __SOZOBON__ */
! win->ws_row = V_CEL_MY + 1;
! win->ws_col = V_CEL_MX + 1;
! win->ws_xpixel = V_X_MAX;
! win->ws_ypixel = V_Y_MAX;
! return 0;
! }
! #ifdef __MINT__
! else if (cmd == TIOCNOTTY && __mint) {
! if ((fd < 0) || !(_isctty(fd))) {
! errno = EBADF;
! return -1;
}
! (void) Fclose(fd);
! null_fd = (int) Fopen(__mint < 9 ? "V:\\null"
! : "U:\\dev\\null", O_RDWR);
! (void) Fforce(-1, null_fd);
! __open_stat[__OPEN_INDEX(-1)].status = FH_UNKNOWN;
! __open_stat[__OPEN_INDEX(fd)].status = FH_UNKNOWN;
! if (null_fd != fd) {
! (void) Fforce(fd, null_fd);
! (void) Fclose(null_fd);
}
! return 0;
! }
#endif /* __MINT__ */
}
if (__mint) {
! r = Fcntl(fd, arg, cmd);
}
else if (istty) {
r = 0;
--- 29,164 ----
int istty = isatty(fd);
struct sgttyb *sg = (struct sgttyb *) arg;
int null_fd;
+ long baud;
if (istty) {
! switch (cmd) {
! case TIOCGETD:
*((int *)arg) = _ttydisc;
return 0;
! break;
! case TIOCSETD:
_ttydisc = *((int *)arg);
return 0;
! break;
! case TIOCLGET:
*((int *)arg) = _ldisc;
return 0;
! break;
! case TIOCLSET:
_ldisc = *((int *)arg);
return 0;
! break;
! case TIOCSWINSZ:
! if (__mint < 9)
! return 0;
! break;
! case TIOCGWINSZ:
! if (__mint < 9) {
! struct winsize *win = (struct winsize *)arg;
#ifndef __SOZOBON__
! (void)linea0();
#else /* __SOZOBON__ */
! linea0();
#endif /* __SOZOBON__ */
! win->ws_row = V_CEL_MY + 1;
! win->ws_col = V_CEL_MX + 1;
! win->ws_xpixel = V_X_MAX;
! win->ws_ypixel = V_Y_MAX;
! return 0;
}
! break;
! #ifdef __MINT__
! case TIOCNOTTY:
! if (__mint) {
! if ((fd < 0) || !(_isctty(fd))) {
! errno = EBADF;
! return -1;
! }
! (void) Fclose(fd);
! null_fd = (int) Fopen(__mint < 9 ? "V:\\null"
! : "U:\\dev\\null", O_RDWR);
! (void) Fforce(-1, null_fd);
! __open_stat[__OPEN_INDEX(-1)].status =
! FH_UNKNOWN;
! __open_stat[__OPEN_INDEX(fd)].status =
! FH_UNKNOWN;
! if (null_fd != fd) {
! (void) Fforce(fd, null_fd);
! (void) Fclose(null_fd);
! }
! return 0;
}
! break;
#endif /* __MINT__ */
+ default:
+ break;
+ }
}
if (__mint) {
! switch (cmd) {
! case TIOCCDTR:
! baud = 0;
! r = Fcntl(fd, &baud, TIOCOBAUD);
! if (r < 0) {
! errno = (int) -r;
! return -1;
! }
! return 0;
! break;
! case TIOCSDTR:
! baud = -1;
! r = Fcntl(fd, &baud, TIOCOBAUD);
! if (r < 0) {
! errno = (int) -r;
! return -1;
! }
! r = Fcntl(fd, &baud, TIOCOBAUD);
! if (r < 0) {
! errno = (int) -r;
! return -1;
! }
! return 0;
! break;
! case TIOCMGET:
! if (__mint >= 0x10a) {
! char g;
! long ssp;
! short *mfp;
! short m;
! struct stat sb;
! long *msig;
!
! msig = (long *) arg;
! r = Fcntl(fd, (long)&sb, FSTAT);
! if (r < 0) {
! errno = -r;
! return -1;
! }
! if (((sb.st_mode & S_IFMT) == S_IFCHR) && (sb.st_rdev == 257))
! {
! *msig = TIOCM_DSR;
! g = Giaccess(0, 14);
! *msig |= ((g & (1 << 3)) ? 0 : TIOCM_RTS);
! *msig |= ((g & (1 << 4)) ? 0 : TIOCM_DTR);
! mfp = ((short *) 0xfffffa00L);
! ssp = Super(0L);
! m = *mfp & 0xff;
! Super(ssp);
! *msig |= ((m & (1 << 1)) ? 0 : TIOCM_CAR);
! *msig |= ((m & (1 << 2)) ? 0 : TIOCM_CTS);
! *msig |= ((m & (1 << 6)) ? 0 : TIOCM_RNG);
! return 0;
! }
! errno = EINVAL;
! return -1;
! break;
! }
! default:
! r = Fcntl(fd, arg, cmd);
! break;
! }
}
else if (istty) {
r = 0;
*** 43.1 1994/02/15 19:34:32
--- isatty.c 1994/02/28 15:00:36
***************
*** 1,22 ****
/* from the original GCC TOS library by jrd */
/* this algorithm is due to Allan Pratt @ Atari. Thanks Allan! */
- #include <errno.h>
- #include <osbind.h>
#include <fcntl.h>
- #include <stdio.h>
#include <ioctl.h>
#include <unistd.h>
- #include <string.h>
- #include <support.h>
- #include <stat.h>
#include <mintbind.h>
#include "lib.h"
struct __open_file __open_stat[__NHANDLES];
! int isatty(fd)
! int fd;
{
int rc;
long oldloc;
--- 1,18 ----
/* from the original GCC TOS library by jrd */
/* this algorithm is due to Allan Pratt @ Atari. Thanks Allan! */
#include <fcntl.h>
#include <ioctl.h>
+ #include <stdio.h>
#include <unistd.h>
#include <mintbind.h>
#include "lib.h"
struct __open_file __open_stat[__NHANDLES];
! int
! isatty(fd)
! int fd;
{
int rc;
long oldloc;
***************
*** 42,81 ****
else
__open_stat[handle].status = FH_ISAFILE;
return (rc); /* return true, false, or error */
- }
-
- /* _isctty(): determine if a file descriptor refers to this process's
- controlling tty.
- */
- int
- _isctty(fd)
- int fd;
- {
- #if 0
- char ctty_name[L_ctermid];
- char ftty_name[L_ctermid];
- #endif
- struct stat st, tt;
- extern int __mint;
-
- if (!(isatty(fd)) || !(isatty(-1)))
- return 0;
- if (fd == -1)
- return 1;
- #if 1
- if (__mint >= 9 && !Fcntl (fd, &st, FSTAT) && !Fcntl (-1, &tt, FSTAT)) {
- /* shouldn't this be as good? the stuff below takes ages...
- (still loses on /dev/aux etc but ttyname can't be much better)
- */
- return (st.st_dev == tt.st_dev && st.st_ino == tt.st_ino);
- }
- /* We know that __mint < 9 (the Fcntl's above don't have the chance
- to fail), use the same algorithm that ttyname() uses in this
- case: it returns "/dev/aux" if fd == -2 */
- return fd != -2;
- #else
- (void) ctermid(ctty_name);
- (void) strncpy(ftty_name, ttyname(fd), L_ctermid);
- return !(strncmp(ctty_name, ftty_name, L_ctermid));
- #endif
}
--- 38,41 ----
*** /dev/null Mon Feb 28 07:43:04 1994
--- isctty.c Mon Feb 28 07:16:38 1994
***************
*** 0 ****
--- 1,32 ----
+ /* _isctty(): determine if a file descriptor refers to this process's
+ controlling tty.
+ */
+
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <ioctl.h>
+ #include <unistd.h>
+ #include <support.h>
+ #include <stat.h>
+ #include <mintbind.h>
+ #include "lib.h"
+
+ int
+ _isctty(fd)
+ int fd;
+ {
+ struct stat st, tt;
+ extern int __mint;
+
+ if (!(isatty(fd)) || !(isatty(-1)))
+ return 0;
+ if (fd == -1)
+ return 1;
+ if (__mint >= 9 && !Fcntl (fd, &st, FSTAT) && !Fcntl (-1, &tt, FSTAT)) {
+ return (st.st_dev == tt.st_dev && st.st_ino == tt.st_ino);
+ }
+ /* We know that __mint < 9 (the Fcntl's above don't have the chance
+ to fail), use the same algorithm that ttyname() uses in this
+ case: it returns "/dev/aux" if fd == -2 */
+ return fd != -2;
+ }
*** 43.1 1994/02/15 19:34:32
--- lockf.c 1994/02/28 12:31:46
***************
*** 3,71 ****
* Placed in the public domain; do with me as you will!
*/
- #include <compiler.h>
- #include "lib.h"
- #include <errno.h>
- #include <fcntl.h>
#include <unistd.h>
! #include <mintbind.h>
! #ifdef __TURBOC__
! #include <sys\file.h>
! #else
! #include <sys/file.h>
! #endif
!
! static int do_lock __PROTO((int fd, int cmd, long size, int whence));
!
! static int
! do_lock(fd, cmd, size, whence)
! int fd;
! int cmd;
! long size;
! int whence;
! {
! struct flock lock;
! int fcmd;
! long r;
! extern int __mint;
!
! if (!__mint) {
! errno = -EINVAL;
! return -1;
! }
! lock.l_whence = whence;
! lock.l_start = 0;
! lock.l_len = size;
! switch (cmd) {
! case F_ULOCK:
! lock.l_type = F_UNLCK;
! fcmd = F_SETLK;
! break;
! case F_TEST:
! lock.l_type = F_WRLCK;
! fcmd = F_GETLK;
! break;
! case F_TLOCK:
! lock.l_type = F_WRLCK;
! fcmd = F_SETLK;
! break;
! case F_LOCK:
! lock.l_type = F_WRLCK;
! if (__mint < 95)
! fcmd = F_SETLK;
! else
! fcmd = F_SETLKW;
! break;
! default:
! errno = -EINVAL;
! return -1;
! }
! if ((r = Fcntl(fd, &lock, fcmd)) < 0) {
! errno = (int) -r;
! return -1;
! }
! return 0;
! }
int
lockf(fd, cmd, size)
--- 3,11 ----
* Placed in the public domain; do with me as you will!
*/
#include <unistd.h>
! #include <fcntl.h>
! #include "lib.h"
int
lockf(fd, cmd, size)
***************
*** 73,94 ****
int cmd;
long size;
{
! return do_lock(fd, cmd, size, 1);
}
- int
- flock(fd, op)
- int fd, op;
- {
- int cmd;
-
- if (op & (LOCK_SH | LOCK_EX))
- cmd = (op & LOCK_NB) ? F_TLOCK : F_LOCK;
- else if (op & LOCK_UN)
- cmd = F_ULOCK;
- else {
- errno = -EINVAL;
- return -1;
- }
- return do_lock(fd, cmd, 0L, 0);
- }
--- 13,18 ----
int cmd;
long size;
{
! return _do_lock(fd, cmd, size, 1);
}
*** /dev/null Mon Feb 28 07:43:04 1994
--- lstat.c Mon Feb 28 09:02:18 1994
***************
*** 0 ****
--- 1,12 ----
+ #include <stat.h>
+ #include "lib.h"
+
+ __EXTERN int _do_stat __PROTO((const char *_path, struct stat *st, int lflag));
+
+ int
+ lstat(path, st)
+ const char *path;
+ struct stat *st;
+ {
+ return _do_stat(path, st, 1);
+ }
*** 43.1 1994/02/15 19:34:32
--- mincl 1994/02/28 13:20:32
***************
*** 23,51 ****
#
# ANSI stuff + support
! ANSI = abort.o atexit.o atof.o atol.o \
bsearch.o \
calloc.o clock.o ctime.o ctype.o \
difftime.o div.o doprnt.o \
eprintf.o \
! fclose.o fdopen.o fflush.o fgetc.o fgets.o filbuf.o \
! fopen.o fprintf.o fputc.o fputs.o fread.o fscanf.o fseek.o \
fsetpos.o fungetc.o fwrite.o \
getbuf.o getenv.o gets.o getw.o \
! localtim.o ltoa.o main.o malloc.o \
! printf.o qsort.o \
! raise.o rand.o realloc.o \
scanf.o sscanf.o setbuf.o setvbuf.o \
setlocal.o sprintf.o strftime.o strtol.o strtoul.o system.o \
tmpnam.o tmpfile.o toxxx.o \
! vfprintf.o vprintf.o wcmb.o \
! wcscat.o wcscmp.o wcscpy.o wcslen.o wnull.o
#
# other miscellaneous stuff
PORT = a64l.o alphasor.o abs.o buffindf.o ctermid.o cuserid.o \
ffs.o findfile.o fopenp.o frwbin.o ftw.o \
gethostn.o getlogin.o getopt.o getpages.o getpass.o getpw.o grp.o \
mktemp.o nlist.o obstack.o \
random.o regexp.o regsup.o \
scandir.o strlwr.o strupr.o strrev.o sync.o \
--- 23,56 ----
#
# ANSI stuff + support
! ANSI = abort.o atexit.o atof.o atoi.o atol.o \
bsearch.o \
calloc.o clock.o ctime.o ctype.o \
difftime.o div.o doprnt.o \
eprintf.o \
! fclose.o fdopen.o fflush.o fgetc.o fgetpos.o fgets.o filbuf.o \
! fopen.o fopen_i.o fprintf.o fputc.o fputs.o \
! fread.o freopen.o fscanf.o fseek.o ftell.o \
fsetpos.o fungetc.o fwrite.o \
getbuf.o getenv.o gets.o getw.o \
! ldiv.o localtim.o ltoa.o \
! main.o malloc.o \
! printf.o puts.o \
! qsort.o \
! raise.o rand.o realloc.o rewind.o \
scanf.o sscanf.o setbuf.o setvbuf.o \
setlocal.o sprintf.o strftime.o strtol.o strtoul.o system.o \
tmpnam.o tmpfile.o toxxx.o \
! vfprintf.o vfscanf.o vprintf.o vscanf.o \
! wcmb.o wcscat.o wcscmp.o wcscpy.o wcslen.o wnull.o
#
# other miscellaneous stuff
PORT = a64l.o alphasor.o abs.o buffindf.o ctermid.o cuserid.o \
+ enoent.o \
ffs.o findfile.o fopenp.o frwbin.o ftw.o \
gethostn.o getlogin.o getopt.o getpages.o getpass.o getpw.o grp.o \
+ l64a.o labs.o \
mktemp.o nlist.o obstack.o \
random.o regexp.o regsup.o \
scandir.o strlwr.o strupr.o strrev.o sync.o \
***************
*** 65,87 ****
#
# stuff to fake unix system calls
! UNIX= access.o alarm.o console.o chdir.o chmod.o close.o dirent.o dup.o \
! exec.o execp.o fcntl.o fork.o getcwd.o getpid.o getuid.o getrusag.o \
! getdtabl.o getgroup.o ioctl.o isatty.o \
! kill.o killpg.o link.o lockf.o lseek.o mkfifo.o mkdir.o mknod.o \
! nice.o open.o \
pause.o pipe.o perror.o pgrp.o popen.o psignal.o putenv.o \
! read.o rename.o rmdir.o sbrk.o select.o sgtty.o sigactio.o \
sigblock.o siglist.o signal.o sleep.o spawn.o spawnve.o spawnvp.o \
setrlimi.o stat.o statfs.o symlink.o sysconf.o \
! time.o times.o timeoday.o ttyname.o \
! uname.o unlink.o unx2dos.o utime.o vfork.o wait.o wait3.o \
! waitpid.o write.o
#
# termios stuff
! TERMIOS= cfspeed.o tcattr.o tcbreak.o tcdrain.o \
tcflow.o tcflush.o tcpgrp.o
#
--- 70,104 ----
#
# stuff to fake unix system calls
! UNIX= access.o alarm.o \
! console.o chdir.o chmod.o chown.o close.o closedir.o \
! do_lock.o do_stat.o dup.o dup2.o \
! execl.o execle.o execp.o execv.o execve.o \
! fcntl.o flock.o fork.o fstat.o \
! getcwd.o getdtabl.o getegid.o geteuid.o getgid.o getgroup.o \
! getpid.o getppid.o \
! getuid.o getrusag.o getwd.o \
! inode.o ioctl.o isatty.o isctty.o \
! kill.o killpg.o link.o lockf.o lseek.o lstat.o \
! mkfifo.o mkdir.o mknod.o \
! nice.o open.o opendir.o \
pause.o pipe.o perror.o pgrp.o popen.o psignal.o putenv.o \
! read.o readdir.o rewinddi.o rename.o rmdir.o \
! sbrk.o seekdir.o select.o \
! setegid.o seteuid.o setgid.o setregid.o setreuid.o setuid.o \
! sgtty.o sigactio.o \
sigblock.o siglist.o signal.o sleep.o spawn.o spawnve.o spawnvp.o \
setrlimi.o stat.o statfs.o symlink.o sysconf.o \
! telldir.o time.o times.o timeoday.o ttyname.o \
! uidgid.o uname.o unlink.o unx2dos.o utime.o \
! vfork.o \
! wait.o wait3.o waitpid.o write.o
#
# termios stuff
! TERMIOS= cfgetisp.o cfgetosp.o cfsetisp.o cfsetosp.o \
! tcattr.o tcbreak.o tcdrain.o \
tcflow.o tcflush.o tcpgrp.o
#
*** 43.1 1994/02/15 19:34:32
--- open.c 1994/02/27 14:07:44
***************
*** 140,146 ****
rv = -ENOENT;
}
! if(rv < (__SMALLEST_VALID_HANDLE)) {
errno = -rv;
return __SMALLEST_VALID_HANDLE - 1;
}
--- 140,148 ----
rv = -ENOENT;
}
! if (rv < (__SMALLEST_VALID_HANDLE)) {
! if ((rv == -EPATH) && (_enoent(filename)))
! rv = -ENOENT;
errno = -rv;
return __SMALLEST_VALID_HANDLE - 1;
}
*** /dev/null Mon Feb 28 07:43:04 1994
--- opendir.c Mon Feb 28 04:56:52 1994
***************
*** 0 ****
--- 1,98 ----
+ /* opendir routine */
+
+ /* under MiNT (v0.9 or better) these use the appropriate system calls.
+ * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
+ *
+ * Written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <types.h>
+ #include <limits.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include "lib.h"
+
+ extern int __mint;
+ extern ino_t __inode; /* in stat.c */
+
+ DIR *
+ opendir(uname)
+ const char *uname;
+ {
+ DIR *d;
+ long r;
+ _DTA *olddta;
+ char name[PATH_MAX];
+ char dirpath[PATH_MAX];
+ char *p;
+
+ d = malloc(sizeof(DIR));
+ if (!d) {
+ errno = ENOMEM;
+ return d;
+ }
+
+ _unx2dos(uname, name);
+
+ if (__mint > 8) {
+ r = Dopendir(name, 0);
+ if ( (r & 0xff000000L) == 0xff000000L ) {
+ errno = (int) -r;
+ free(d);
+ return 0;
+ }
+ d->handle = r;
+ d->buf.d_off = 0;
+ return d;
+ }
+
+ /* TOS emulation routines */
+
+ p = name;
+ if (p) {
+ /* find the end of the string */
+ for (p = name; *p; p++) ;
+
+ /* make sure the string ends in '\' */
+ if (*(p-1) != '\\') {
+ *p++ = '\\';
+ }
+ }
+
+ strcpy(p, "*.*");
+ olddta = Fgetdta();
+ Fsetdta(&(d->dta));
+ r = Fsfirst(name, 0x17);
+ Fsetdta(olddta);
+
+ if (r == 0) {
+ d->status = _STARTSEARCH;
+ } else if (r == -ENOENT) {
+ d->status = _NMFILE;
+ } else {
+ free(d);
+ errno = (int) -r;
+ return 0;
+ }
+ d->buf.d_off = 0;
+ /* for rewinddir: if necessary, build a relative path */
+ if (name[1] == ':') { /* absolute path, no problem */
+ dirpath[0] = 0;
+ } else {
+ dirpath[0] = Dgetdrv() + 'A';
+ dirpath[1] = ':';
+ dirpath[2] = 0;
+ if (*name != '\\')
+ (void)Dgetpath(dirpath+2, 0);
+ }
+ d->dirname = malloc(strlen(dirpath)+strlen(name)+1);
+ if (d->dirname) {
+ strcpy(d->dirname, dirpath);
+ strcat(d->dirname, name);
+ }
+ return d;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- readdir.c Mon Feb 28 04:57:50 1994
***************
*** 0 ****
--- 1,74 ----
+ /* readdir routine */
+
+ /* under MiNT (v0.9 or better) these use the appropriate system calls.
+ * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
+ *
+ * Written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <types.h>
+ #include <limits.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include "lib.h"
+
+ extern int __mint;
+ extern ino_t __inode; /* in stat.c */
+
+ struct dirent *
+ readdir(d)
+ DIR *d;
+ {
+ struct dbuf {
+ long ino;
+ char name[NAME_MAX + 1];
+ } dbuf;
+ long r;
+ _DTA *olddta;
+ struct dirent *dd = &d->buf;
+
+ if (__mint > 8) {
+ r = (int)Dreaddir((int)(NAME_MAX+1+sizeof(long)), d->handle, (char *) &dbuf);
+ if (r == -ENMFIL)
+ return 0;
+ else if (r) {
+ errno = (int) -r;
+ return 0;
+ }
+ dd->d_ino = dbuf.ino;
+ dd->d_off++;
+ dd->d_reclen = (short)strlen(dbuf.name);
+ strcpy(dd->d_name, dbuf.name);
+ return dd;
+ }
+ /* ordinary TOS search, using Fsnext. Note that the first time through,
+ * Fsfirst has already provided valid data for us; for subsequent
+ * searches, we need Fsnext.
+ */
+ if (d->status == _NMFILE)
+ return 0;
+ if (d->status == _STARTSEARCH) {
+ d->status = _INSEARCH;
+ } else {
+ olddta = Fgetdta();
+ Fsetdta(&(d->dta));
+ r = Fsnext();
+ Fsetdta(olddta);
+ if (r == -ENMFIL) {
+ d->status = _NMFILE;
+ return 0;
+ } else if (r) {
+ errno = (int)-r;
+ return 0;
+ }
+ }
+ dd->d_ino = __inode++;
+ dd->d_off++;
+ _dos2unx(d->dta.dta_name, dd->d_name);
+ dd->d_reclen = (short)strlen(dd->d_name);
+ return dd;
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- rewinddi.c Mon Feb 28 04:59:42 1994
***************
*** 0 ****
--- 1,50 ----
+ /* rewinddir routine */
+
+ /* under MiNT (v0.9 or better) these use the appropriate system calls.
+ * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
+ *
+ * Written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <types.h>
+ #include <limits.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <osbind.h>
+ #include <mintbind.h>
+ #include "lib.h"
+
+ extern int __mint;
+ extern ino_t __inode; /* in stat.c */
+
+ void
+ rewinddir(dirp)
+ DIR *dirp;
+ {
+ long r;
+ _DTA *olddta;
+
+ if (__mint >= 9) {
+ (void)Drewinddir(dirp->handle);
+ dirp->buf.d_off = 0;
+ return;
+ }
+
+ /* I wish POSIX had allowed an error to occur here! */
+ if (!dirp->dirname) {
+ return;
+ }
+
+ olddta = Fgetdta();
+ Fsetdta(&(dirp->dta));
+ r = Fsfirst(dirp->dirname, 0x17);
+ Fsetdta(olddta);
+ if (r == 0) {
+ dirp->status = _STARTSEARCH;
+ } else {
+ dirp->status = _NMFILE;
+ }
+ dirp->buf.d_off = 0;
+ }
*** 43.1 1994/02/15 19:34:32
--- scanf.c 1994/02/24 16:42:56
***************
*** 259,267 ****
charcnt++;
c = (*get) (ip);
if (c == EOF)
! goto done;
if (c == 'x' || c == 'X')
goto skip1;
}
else if (neg == -1)
{
--- 259,272 ----
charcnt++;
c = (*get) (ip);
if (c == EOF)
! goto savnum;
if (c == 'x' || c == 'X')
goto skip1;
+ /* else unget the character, it may already be a
+ non-digit and the number would be rejected */
+ charcnt--;
+ (*unget) (c, ip);
+ c = '0';
}
else if (neg == -1)
{
*** /dev/null Mon Feb 28 07:43:04 1994
--- seekdir.c Mon Feb 28 05:05:10 1994
***************
*** 0 ****
--- 1,28 ----
+ /* seekdir routine */
+
+ /* under MiNT (v0.9 or better) these use the appropriate system calls.
+ * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
+ *
+ * Written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <types.h>
+ #include <limits.h>
+ #include <dirent.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ /* not POSIX */
+
+ void
+ seekdir(dirp, loc)
+ DIR *dirp;
+ off_t loc;
+ {
+ rewinddir(dirp);
+ while (dirp->buf.d_off != loc) {
+ if (!readdir(dirp))
+ break;
+ }
+ }
*** 43.1 1994/02/15 19:34:32
--- stat.c 1994/02/28 15:34:04
***************
*** 1,332 ****
- /*
- * stat, fstat, lstat emulation for TOS
- * written by Eric R. Smith and placed in the public domain
- */
-
- #include <limits.h>
- #include <types.h>
#include <stat.h>
- #include <ctype.h>
- #include <errno.h>
- #include <osbind.h>
- #include <mintbind.h>
- #include <string.h>
- #include <time.h>
- #include <unistd.h>
- #include <support.h>
- #include <ioctl.h> /* for FSTAT */
#include "lib.h"
! extern int __mint;
!
! ino_t __inode = 32; /* used in readdir also */
!
! /* for backwards compatibilty: if nonzero, files are checked to see if
! * they have the TOS executable magic number in them
! */
!
! int _x_Bit_set_in_stat = 0;
!
!
!
! /* date for files (like root directories) that don't have one */
! #define OLDDATE _unixtime(0,0)
!
! /*
! * macro for converting a long in DOS format to one in Unix format. "x"
! * _must_ be an lvalue!
! */
!
! #define CONVERT(x) (x = _unixtime( ((short *)&x)[0], ((short *)&x)[1] ))
!
! /*
! * common routine for stat() and lstat(); if "lflag" is 0, then symbolic
! * links are automatically followed (like stat), if 1 then they are not
! * (like lstat)
! */
!
! static int do_stat __PROTO((const char *_path, struct stat *st,
! int lflag));
!
! static int
! do_stat(_path, st, lflag)
! const char *_path;
! struct stat *st;
! int lflag;
! {
! long r;
! _DTA *olddta;
! int nval;
! char path[PATH_MAX];
! char *ext, drv;
! int fd;
! short magic;
! _DTA d;
! int isdot = 0;
!
! if (!_path) {
! errno = EFAULT;
! return -1;
! }
!
! /*
! * _unx2dos returns 1 for device names (like /dev/con)
! */
! nval = _unx2dos(_path, path);
!
! /* for MiNT 0.9 and up, we use the built in stat() call */
! if (__mint >= 9) {
! r = Fxattr(lflag, path, st);
! if (r) {
! errno = (int) -r;
! return -1;
! }
! CONVERT(st->st_mtime);
! CONVERT(st->st_atime);
! CONVERT(st->st_ctime);
! /* Most versions of Unix count in 512 byte blocks */
! st->st_blocks = (st->st_blocks * st->st_blksize) / 512;
! /* if we hit a symbolic link, try to get its size right */
! if (lflag && ((st->st_mode & S_IFMT) == S_IFLNK)) {
! char buf[PATH_MAX + 1];
! char buf1[PATH_MAX + 1];
! r = Freadlink(PATH_MAX, buf, path);
! if (r < 0)
! {
! errno = (int) -r;
! return -1;
! }
! buf[PATH_MAX] = 0;
! _dos2unx (buf, buf1);
! st->st_size = strlen (buf1);
! }
! return 0;
! }
!
! /* otherwise, check to see if we have a name like CON: or AUX: */
! if (nval == 1) {
! st->st_mode = S_IFCHR | 0600;
! st->st_attr = 0;
! st->st_ino = ++__inode;
! st->st_rdev = 0;
! st->st_mtime = st->st_ctime = st->st_atime =
! time((time_t *)0) - 2;
! st->st_dev = 0;
! st->st_nlink = 1;
! st->st_uid = geteuid();
! st->st_gid = getegid();
! st->st_size = st->st_blocks = 0;
! st->st_blksize = 1024;
! return 0;
! }
!
! /* A file name: check for root directory of a drive */
! if (path[0] == '\\' && path[1] == 0) {
! drv = Dgetdrv() + 'A';
! goto rootdir;
! }
!
! if ( ((drv = path[0]) != 0) && path[1] == ':' &&
! (path[2] == 0 || (path[2] == '\\' && path[3] == 0)) ) {
! rootdir:
! st->st_mode = S_IFDIR | 0755;
! st->st_attr = FA_DIR;
! st->st_dev = isupper(drv) ? drv - 'A' : drv - 'a';
! st->st_ino = 2;
! st->st_mtime = st->st_ctime = st->st_atime = OLDDATE;
! goto fill_dir;
! }
!
! /* forbid wildcards in path names */
! if (index(path, '*') || index(path, '?')) {
! errno = ENOENT;
! return -1;
! }
!
! /* OK, here we're going to have to do an Fsfirst to get the date */
! /* NOTE: Fsfirst(".",-1) or Fsfirst("..",-1) both fail under TOS,
! * so we kludge around this by using the fact that Fsfirst(".\*.*"
! * or "..\*.*" will return the correct file first (except, of course,
! * in root directories :-( ).
! * NOTE2: Some versions of TOS don't like Fsfirst("RCS\\", -1) either,
! * so we do the same thing if the path ends in '\\'.
! */
!
! /* find the end of the string */
! for (ext = path; ext[0] && ext[1]; ext++) ;
!
! /* add appropriate kludge if necessary */
! if (*ext == '.' && (ext == path || ext[-1] == '\\' || ext[-1] == '.')) {
! isdot = 1;
! strcat(path, "\\*.*");
! } else if (*ext == '\\') {
! isdot = 1;
! strcat(path, "*.*");
! }
! olddta = Fgetdta();
! Fsetdta(&d);
! r = Fsfirst(path, 0xff);
! Fsetdta(olddta);
! if (r < 0) {
! if (isdot && r == -ENOENT) goto rootdir;
! errno = (int) -r;
! return -1;
! }
!
! if (isdot && ((d.dta_name[0] != '.') || (d.dta_name[1]))) {
! goto rootdir;
! }
!
! st->st_mtime = st->st_ctime = st->st_atime =
! _unixtime(d.dta_time, d.dta_date);
! if (((drv = *path) != 0) && path[1] == ':')
! st->st_dev = toupper(drv) - 'A';
! else
! st->st_dev = Dgetdrv();
!
! st->st_ino = __inode++;
! st->st_attr = d.dta_attribute;
! if (__mint && st->st_dev == ('Q' - 'A'))
! st->st_mode = 0644 | S_IFIFO;
! else {
! st->st_mode = 0644 | (st->st_attr & FA_DIR ?
! S_IFDIR | 0111 : S_IFREG);
! }
!
! if (st->st_attr & FA_RDONLY)
! st->st_mode &= ~0222; /* no write permission */
! if (st->st_attr & FA_HIDDEN)
! st->st_mode &= ~0444; /* no read permission */
!
! /* check for a file with an executable extension */
! ext = strrchr(_path, '.');
! if (ext) {
! if (!strcmp(ext, ".ttp") || !strcmp(ext, ".prg") ||
! !strcmp(ext, ".tos") || !strcmp(ext, ".g") ||
! !strcmp(ext, ".sh") || !strcmp(ext, ".bat")) {
! st->st_mode |= 0111;
! }
! }
! if ( (st->st_mode & S_IFMT) == S_IFREG) {
! if (_x_Bit_set_in_stat) {
! if ((fd = (int) Fopen(path,0)) < 0) {
! errno = -fd;
! return -1;
! }
! magic = 0;
! (void)Fread(fd,2,(char *)&magic);
! (void)Fclose(fd);
! if (magic == 0x601A /* TOS executable */
! || magic == 0x2321) /* "#!" shell file */
! st->st_mode |= 0111;
! }
! st->st_size = d.dta_size;
! /* in Unix, blocks are measured in 512 bytes */
! st->st_blocks = (st->st_size + 511) / 512;
! st->st_nlink = 1; /* we dont have hard links */
! } else {
! fill_dir:
! st->st_size = 1024;
! st->st_blocks = 2;
! st->st_nlink = 2; /* "foo" && "foo/.." */
! }
!
! st->st_rdev = 0;
! st->st_uid = geteuid(); /* the current user owns every file */
! st->st_gid = getegid();
! st->st_blksize = 1024;
! return 0;
! }
!
!
! /*
! * fstat: if we're not running under MiNT, this is pretty bogus.
! * what we can really find is:
! * modification time: via Fdatime()
! * file size: via Fseek()
! * fortunately, these are the things most programs are interested in.
! * BUG: passing an invalid file descriptor gets back a stat structure for
! * a tty.
! */
!
! int
! fstat(fd, st)
! int fd;
! struct stat *st;
! {
! long oldplace, r;
! _DOSTIME timeptr;
! short magic;
!
! if (__mint >= 9) { /* use FSTAT Fcntl */
! r = Fcntl(fd, (long)st, FSTAT);
! if (r) {
! errno = (int) -r;
! return -1;
! }
! CONVERT(st->st_mtime);
! CONVERT(st->st_atime);
! CONVERT(st->st_ctime);
! st->st_blocks = (st->st_blocks * st->st_blksize) / 512;
! return 0;
! }
!
! r = Fdatime(&timeptr, fd, 0);
! if (r < 0) { /* assume TTY */
! st->st_mode = S_IFCHR | 0600;
! st->st_attr = 0;
! st->st_mtime = st->st_ctime = st->st_atime =
! time((time_t *)0) - 2;
! st->st_size = 0;
! } else {
! st->st_mtime = st->st_atime = st->st_ctime =
! _unixtime(timeptr.time, timeptr.date);
! st->st_mode = S_IFREG | 0644; /* this may be false */
! st->st_attr = 0; /* because this is */
!
! /* get current file location */
! oldplace = Fseek(0L, fd, SEEK_CUR);
! if (oldplace < 0) { /* can't seek -- must be pipe */
! st->st_mode = S_IFIFO | 0644;
! st->st_size = 1024;
! } else {
! r = Fseek(0L, fd, SEEK_END); /* go to end of file */
! st->st_size = r;
! (void)Fseek(0L, fd, SEEK_SET); /* go to start of file */
! /* check for executable file */
! if (Fread(fd, 2, (char *)&magic) == 2) {
! if (magic == 0x601a || magic == 0x2321)
! st->st_mode |= 0111;
! }
! (void)Fseek(oldplace, fd, SEEK_SET);
! }
! }
!
! /* all this stuff is likely bogus as well. sigh. */
! st->st_dev = Dgetdrv();
! st->st_rdev = 0;
! st->st_uid = getuid();
! st->st_gid = getgid();
! st->st_blksize = 1024;
! /* note: most Unixes measure st_blocks in 512 byte units */
! st->st_blocks = (st->st_size + 511) / 512;
! st->st_ino = ++__inode;
! st->st_nlink = 1;
! return 0;
! }
!
! int
! lstat(path, st)
! const char *path;
! struct stat *st;
! {
! return do_stat(path, st, 1);
! }
int
stat(path, st)
const char *path;
struct stat *st;
{
! return do_stat(path, st, 0);
}
--- 1,12 ----
#include <stat.h>
#include "lib.h"
! __EXTERN int _do_stat __PROTO((const char *_path, struct stat *st, int lflag));
int
stat(path, st)
const char *path;
struct stat *st;
{
! return _do_stat(path, st, 0);
}
*** 43.1 1994/02/15 19:34:32
--- sync.c 1994/02/28 02:19:34
***************
*** 17,22 ****
--- 17,23 ----
#include <stat.h>
#include <errno.h>
#include <support.h>
+ #include <string.h>
extern int __mint;
***************
*** 34,49 ****
* query all known drives for a valid MinixFs
* if we find one, sync it.
*/
! int sync(void)
{
long magic;
unsigned long drives;
int i, rv;
! char path[] = "A:\\";
!
if (!__mint)
return 0;
drives = Dsetdrv(Dgetdrv());
drives &= ~0x3; /* don't sync the floppys */
--- 35,53 ----
* query all known drives for a valid MinixFs
* if we find one, sync it.
*/
! int
! sync()
{
long magic;
unsigned long drives;
int i, rv;
! char path[4];
!
if (!__mint)
return 0;
+ strcpy(path, "A:\\");
+
drives = Dsetdrv(Dgetdrv());
drives &= ~0x3; /* don't sync the floppys */
***************
*** 76,92 ****
* since MFS 605 always syncs all the buffers, we don't bother
* to get the full path.
*/
! int fsync(fd)
int fd;
{
int rv;
long magic = 0L;
! char path[] = "A:\\";
struct stat statbuf;
if (!__mint)
return 0;
if (fstat(fd, &statbuf))
return -1; /* errno set from fstat */
--- 80,98 ----
* since MFS 605 always syncs all the buffers, we don't bother
* to get the full path.
*/
! int
! fsync(fd)
int fd;
{
int rv;
long magic = 0L;
! char path[4];
struct stat statbuf;
if (!__mint)
return 0;
+ strcpy(path, "A:\\");
if (fstat(fd, &statbuf))
return -1; /* errno set from fstat */
***************
*** 114,120 ****
* so just do 'cat junk1 >junk2;sync' from your shell
* and listen to your harddisk.
*/
! int main (void)
{
sync();
return 0;
--- 120,127 ----
* so just do 'cat junk1 >junk2;sync' from your shell
* and listen to your harddisk.
*/
! int
! main()
{
sync();
return 0;
*** 43.1 1994/02/15 19:34:32
--- tcdrain.c 1994/02/19 13:03:38
***************
*** 1,17 ****
/*
Public domain termios tcdrain() for the MiNT library
! 10 October 1993 entropy@terminator.rs.itd.umich.edu -- first attempt
*/
#include <errno.h>
#include <types.h>
#include <termios.h>
int
tcdrain(fd)
int fd;
{
! errno = -EINVAL;
! return -1;
}
--- 1,36 ----
/*
Public domain termios tcdrain() for the MiNT library
! 10 October 1993 entropy@terminator.rs.itd.umich.edu
*/
#include <errno.h>
#include <types.h>
+ #include <ioctl.h>
+ #include <mintbind.h>
#include <termios.h>
+ extern int __mint;
+
int
tcdrain(fd)
int fd;
{
! long outq;
! long r;
!
! if (__mint < 0x10a)
! {
! errno = -EINVAL;
! return -1;
! }
! do
! {
! r = Fcntl((short) fd, &outq, TIOCOUTQ);
! if (r < 0) {
! errno = (int) -r;
! return -1;
! }
! } while (outq != 0);
! return 0;
}
*** 43.1 1994/02/15 19:34:32
--- tcflush.c 1994/02/19 12:23:00
***************
*** 33,39 ****
errno = EINVAL;
return -1;
}
! r = Fcntl((short) fd, flushtype, TIOCFLUSH);
if (r < 0) {
errno = (int) -r;
return -1;
--- 33,39 ----
errno = EINVAL;
return -1;
}
! r = Fcntl((short) fd, &flushtype, TIOCFLUSH);
if (r < 0) {
errno = (int) -r;
return -1;
*** /dev/null Mon Feb 28 07:43:04 1994
--- telldir.c Mon Feb 28 05:04:00 1994
***************
*** 0 ****
--- 1,24 ----
+ /* telldir routine */
+
+ /* under MiNT (v0.9 or better) these use the appropriate system calls.
+ * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
+ *
+ * Written by Eric R. Smith and placed in the public domain
+ */
+
+ #include <types.h>
+ #include <limits.h>
+ #include <dirent.h>
+ #include "lib.h"
+
+ extern int __mint;
+
+ /* not POSIX */
+
+ off_t
+ telldir(dirp)
+ DIR *dirp;
+ {
+ return dirp->buf.d_off;
+ }
+
*** 43.1 1994/02/15 19:34:32
--- unlink.c 1994/02/27 11:55:56
***************
*** 32,37 ****
--- 32,39 ----
r = (int)Fdelete(name);
if (r < 0) {
+ if ((r == -EPATH) && (_enoent(name)))
+ r = -ENOENT;
errno = -r;
return -1;
}
*** /dev/null Mon Feb 28 07:43:04 1994
--- vfscanf.c Mon Feb 28 06:19:02 1994
***************
*** 0 ****
--- 1,14 ----
+ /* from Dale Schumacher's dLibs */
+
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include "lib.h"
+
+ int
+ vfscanf(fp, fmt, arg)
+ FILE *fp;
+ const char *fmt;
+ va_list arg;
+ {
+ return (_scanf(fp, fgetc, fungetc, fmt, arg));
+ }
*** /dev/null Mon Feb 28 07:43:04 1994
--- vscanf.c Mon Feb 28 06:17:16 1994
***************
*** 0 ****
--- 1,14 ----
+ /* from Dale Schumacher's dLibs */
+
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include "lib.h"
+
+ int
+ vscanf(fmt, arg)
+ const char *fmt;
+ va_list arg;
+ {
+ return (_scanf(stdin, fgetc, fungetc, fmt, arg));
+ }
+
*** 43.1 1994/02/15 20:20:36
--- purec/Makefile 1994/02/28 17:56:40
***************
*** 299,321 ****
### how to build MINTLIB
COMMONSRC := a64l.c abort.c abs.c access.c alarm.c alphasor.c atexit.c \
! atol.c bblink.c bcmp.c binmode.c bsearch.c calloc.c cfspeed.c chdir.c \
! chmod.c clock.c close.c console.c crtinit.c ctermid.c \
! ctime.c ctype.c defmode.c dirent.c \
! doprnt.c dup.c eprintf.c exec.c execp.c fclose.c fcntl.c fdopen.c fflush.c \
! fgetc.c fgets.c filbuf.c findfile.c fopen.c fopenp.c fork.c fprintf.c \
! fputc.c fputs.c fread.c frwbin.c fscanf.c fseek.c fsetpos.c ftw.c \
! fungetc.c fwrite.c getbuf.c getcwd.c getdtabl.c getenv.c getgroup.c \
! gethostn.c getlogin.c getopt.c getpages.c getpass.c getpid.c getpw.c \
! getrusag.c gets.c getuid.c getw.c grp.c heapbase.c ic.c ident.c ig.c \
! il.c inistack.c initsig.c ioctl.c ip.c isatty.c iw.c kill.c killpg.c \
! link.c localtim.c lockf.c lseek.c ltoa.c main.c malloc.c memccpy.c \
memchr.c memcmp.c mkdir.c mkfifo.c mknod.c mktemp.c nice.c nlist.c \
! obstack.c open.c \
! pause.c perror.c pipe.c pgrp.c popen.c printf.c psignal.c putenv.c \
qsort.c raise.c \
! rand.c random.c read.c realloc.c regexp.c regsup.c rename.c rmdir.c \
! sbrk.c scandir.c scanf.c select.c setbuf.c setlocal.c setrlimi.c \
setvbuf.c sgtty.c sigactio.c sigblock.c siglist.c signal.c sleep.c \
spawn.c spawnve.c spawnvp.c sprintf.c sscanf.c stat.c statfs.c stksiz.c \
strcat.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c strdup.c \
--- 299,335 ----
### how to build MINTLIB
COMMONSRC := a64l.c abort.c abs.c access.c alarm.c alphasor.c atexit.c \
! atoi.c atol.c bblink.c bcmp.c binmode.c bsearch.c calloc.c \
! cfgetisp.c cfgetosp.c cfsetisp.c cfsetosp.c chdir.c \
! chmod.c chown.c clock.c close.c closedir.c console.c crtinit.c ctermid.c \
! ctime.c ctype.c defmode.c \
! doprnt.c do_lock.c do_stat.c dup.c dup2.c eprintf.c \
! execl.c execle.c execp.c execv.c execve.c \
! fclose.c fcntl.c fdopen.c fflush.c \
! fgetc.c fgetpos.c fgets.c filbuf.c findfile.c flock.c fopen.c \
! fopen_i.c fopenp.c fork.c fprintf.c \
! fputc.c fputs.c fread.c freopen.c frwbin.c \
! fscanf.c fseek.c fsetpos.c fstat.c ftell.c ftw.c \
! fungetc.c fwrite.c getbuf.c getcwd.c \
! getdtabl.c getenv.c getegid.c geteuid.c getgid.c getgroup.c \
! gethostn.c getlogin.c getopt.c getpages.c \
! getpass.c getpid.c getppid.c getpw.c \
! getrusag.c gets.c getuid.c getw.c getwd.c \
! grp.c heapbase.c ic.c ident.c ig.c \
! il.c inistack.c initsig.c inode.c ioctl.c \
! ip.c isatty.c isctty.c iw.c kill.c killpg.c \
! l64a.c labs.c ldiv.c link.c localtim.c lockf.c lseek.c lstat.c \
! ltoa.c main.c malloc.c memccpy.c \
memchr.c memcmp.c mkdir.c mkfifo.c mknod.c mktemp.c nice.c nlist.c \
! obstack.c open.c opendir.c \
! pause.c perror.c pipe.c pgrp.c popen.c \
! printf.c psignal.c putenv.c puts.c \
qsort.c raise.c \
! rand.c random.c read.c readdir.c realloc.c \
! regexp.c regsup.c rename.c rewind.c rewinddi.c rmdir.c \
! sbrk.c scandir.c scanf.c seekdir.c select.c \
! setbuf.c setegid.c seteuid.c setlocal.c \
! setregid.c setreuid.c setrlimi.c setgid.c setuid.c \
setvbuf.c sgtty.c sigactio.c sigblock.c siglist.c signal.c sleep.c \
spawn.c spawnve.c spawnvp.c sprintf.c sscanf.c stat.c statfs.c stksiz.c \
strcat.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c strdup.c \
***************
*** 323,331 ****
strncpy.c strnicmp.c strpbrk.c strrchr.c strrev.c strspn.c strstr.c \
strtok.c strtol.c strtoul.c strupr.c symlink.c sysconf.c system.c \
sysvar.c tcattr.c tcbreak.c tcdrain.c tcflow.c tcflush.c tcpgrp.c \
! textio.c thread.c time.c timeoday.c times.c tmpfile.c tmpnam.c \
! toxxx.c truncate.c ttyname.c uname.c unlink.c unx2dos.c utime.c \
! utmp.c vfprintf.c vprintf.c wait.c \
wait3.c waitpid.c wcmb.c \
wcscat.c wcscmp.c wcscpy.c wcslen.c wnull.c write.c wtmp.c
COMMONSRC := $(addprefix $(COMMONDIR)/,$(COMMONSRC))
--- 337,345 ----
strncpy.c strnicmp.c strpbrk.c strrchr.c strrev.c strspn.c strstr.c \
strtok.c strtol.c strtoul.c strupr.c symlink.c sysconf.c system.c \
sysvar.c tcattr.c tcbreak.c tcdrain.c tcflow.c tcflush.c tcpgrp.c \
! telldir.c textio.c thread.c time.c timeoday.c times.c tmpfile.c tmpnam.c \
! toxxx.c truncate.c ttyname.c uidgid.c uname.c unlink.c unx2dos.c utime.c \
! utmp.c vfprintf.c vfscanf.c vprintf.c vscanf.c wait.c \
wait3.c waitpid.c wcmb.c \
wcscat.c wcscmp.c wcscpy.c wcslen.c wnull.c write.c wtmp.c
COMMONSRC := $(addprefix $(COMMONDIR)/,$(COMMONSRC))
*** 43.1 1994/02/15 20:20:36
--- purec/mintlib.prj 1994/02/28 18:13:30
***************
*** 19,24 ****
--- 19,25 ----
..\alphasor.c
..\atexit.c
; ..\atof.c (use the version in pcstdlib/tcstdlib)
+ ..\atoi.c
..\atol.c
..\bblink.c
..\bcmp.c
***************
*** 26,36 ****
..\bsearch.c
bzero.c
..\calloc.c
! ..\cfspeed.c
..\chdir.c
..\chmod.c
..\clock.c
..\close.c
..\console.c
..\crtinit.c [-P -S- -T-]
..\ctermid.c
--- 27,42 ----
..\bsearch.c
bzero.c
..\calloc.c
! ..\cfgetisp.c
! ..\cfgetosp.c
! ..\cfsetisp.c
! ..\cfsetosp.c
..\chdir.c
..\chmod.c
+ ..\chown.c
..\clock.c
..\close.c
+ ..\closedir.c
..\console.c
..\crtinit.c [-P -S- -T-]
..\ctermid.c
***************
*** 38,68 ****
..\ctype.c
..\defmode.c
; ..\difftime.c (pick this up from mintflt.lib or mint881.lib)
- ..\dirent.c
..\doprnt.c
..\dup.c
..\eprintf.c
! ..\exec.c
..\execp.c
..\fclose.c
..\fcntl.c
..\fdopen.c
..\fflush.c
..\fgetc.c
..\fgets.c
..\filbuf.c
..\findfile.c
..\fopen.c
..\fopenp.c
..\fork.c
..\fprintf.c
..\fputc.c
..\fputs.c
..\fread.c
..\frwbin.c
..\fscanf.c
..\fseek.c
..\fsetpos.c
..\ftw.c
..\fungetc.c
..\fwrite.c
--- 44,85 ----
..\ctype.c
..\defmode.c
; ..\difftime.c (pick this up from mintflt.lib or mint881.lib)
..\doprnt.c
+ ..\do_lock.c
+ ..\do_stat.c
..\dup.c
+ ..\dup2.c
..\eprintf.c
! ..\execl.c
! ..\execle.c
..\execp.c
+ ..\execv.c
+ ..\execve.c
..\fclose.c
..\fcntl.c
..\fdopen.c
..\fflush.c
..\fgetc.c
+ ..\fgetpos.c
..\fgets.c
..\filbuf.c
..\findfile.c
+ ..\flock.c
..\fopen.c
+ ..\fopen_i.c
..\fopenp.c
..\fork.c
..\fprintf.c
..\fputc.c
..\fputs.c
..\fread.c
+ ..\freopen.c
..\frwbin.c
..\fscanf.c
..\fseek.c
..\fsetpos.c
+ ..\fstat.c
+ ..\ftell.c
..\ftw.c
..\fungetc.c
..\fwrite.c
***************
*** 70,75 ****
--- 87,94 ----
..\getcwd.c
..\getdtabl.c
..\getenv.c
+ ..\getegid.c
+ ..\geteuid.c
..\getgroup.c
..\gethostn.c
..\getlogin.c
***************
*** 77,87 ****
--- 96,108 ----
..\getpages.c
..\getpass.c
..\getpid.c
+ ..\getppid.c
..\getpw.c
..\getrusag.c
..\gets.c
..\getuid.c
..\getw.c
+ ..\getwd.c
..\grp.c
..\heapbase.c
..\ic.c
***************
*** 90,105 ****
--- 111,132 ----
..\il.c
..\inistack.c
..\initsig.c
+ ..\inode.c
..\ioctl.c
..\ip.c
..\isatty.c
+ ..\isctty.c
..\iw.c
..\kill.c
..\killpg.c
+ ..\l64a.c
+ ..\labs.c
+ ..\ldiv.c
..\link.c
..\localtim.c
..\lockf.c
..\lseek.c
+ ..\lstat.c
..\ltoa.c
..\main.c [-P]
..\malloc.c
***************
*** 115,120 ****
--- 142,148 ----
..\nlist.c
..\obstack.c
..\open.c
+ ..\opendir.c
..\pause.c
..\perror.c
..\pipe.c
***************
*** 123,145 ****
--- 151,184 ----
..\printf.c
..\psignal.c
..\putenv.c
+ ..\puts.c
..\qsort.c [-S -T]
..\raise.c
..\rand.c
..\random.c
..\read.c
+ ..\readdir.c
..\realloc.c
..\regexp.c
..\regsup.c
..\rename.c
+ ..\rewind.c
+ ..\rewinddi.c
..\rmdir.c
..\sbrk.c
..\scandir.c
..\scanf.c
+ ..\seekdir.c
..\select.c
..\setbuf.c
+ ..\setegid.c
+ ..\seteuid.c
+ ..\setgid.c
..\setlocal.c
+ ..\setregid.c
+ ..\setreuid.c
..\setrlimi.c
+ ..\setuid.c
..\setvbuf.c
..\sgtty.c
..\sigactio.c
***************
*** 189,194 ****
--- 228,234 ----
..\tcflow.c
..\tcflush.c
..\tcpgrp.c
+ ..\telldir.c
..\textio.c
..\thread.c [-P -S-]
..\time.c
***************
*** 199,211 ****
--- 239,254 ----
..\toxxx.c
..\truncate.c
..\ttyname.c
+ ..\uidgid.c
..\uname.c
..\unlink.c
..\unx2dos.c
..\utime.c
..\utmp.c
..\vfprintf.c
+ ..\vfscanf.c
..\vprintf.c
+ ..\vscanf.c
..\wait.c
..\wait3.c
..\waitpid.c
*** 43.1 1994/02/15 20:23:28
--- sozobon/makefile 1994/02/28 17:41:06
***************
*** 47,93 ****
# These are in alphabetical order to make it easy to find one.
OBJECTS = \
! abort.o abs.o access.o alarm.o alloca.o alphasor.o \
! atexit.o atol.o \
bcmp.o bcopy.o binmode.o bsearch.o bzero.o \
! calloc.o chdir.o chmod.o clock.o close.o console.o crtinit.o \
! ctermid.o ctime.o ctype.o cuserid.o \
! defmode.o difftime.o dirent.o doprnt.o dup.o \
! eprintf.o exec.o execp.o\
! fclose.o fcntl.o fdopen.o fflush.o ffs.o fgetc.o fgets.o filbuf.o \
! findfile.o fopen.o fopenp.o fork.o fprintf.o fputc.o fputs.o \
! fread.o frwbin.o fscanf.o fseek.o fsetpos.o ftw.o fungetc.o \
fwrite.o \
! getbuf.o getcwd.o getdtabl.o getenv.o getgroup.o gethostn.o \
! getlogin.o getopt.o getpages.o getpass.o getpid.o getpw.o \
! getrusag.o gets.o getuid.o getw.o grp.o \
heapbase.o \
! ic.o ident.o ig.o il.o inistack.o initsig.o ioctl.o ip.o \
! isatty.o iw.o \
kill.o killpg.o \
! linea.o link.o lmalloc.o localtim.o lockf.o lseek.o ltoa.o \
! main.o malloc.o memccpy.o memchr.o memcmp.o mkdir.o mknod.o \
! mktemp.o \
! nice.o \
! obstack.o open.o osbind.o \
pause.o perror.o pgrp.o pipe.o popen.o printf.o psignal.o putenv.o \
qsort.o \
! raise.o rand.o random.o read.o realloc.o regexp.o regsup.o \
! rename.o rmdir.o \
! sbrk.o scandir.o scanf.o select.o setbuf.o setjmp.o setlocal.o \
! setrlimi.o setvbuf.o sgtty.o sigactio.o sigblock.o siglist.o \
signal.o sleep.o sozolong.o sozulong.o spawn.o spawnve.o \
spawnvp.o sprintf.o sscanf.o stat.o statfs.o stksiz.o strcat.o \
strchr.o strcmp.o strcoll.o strcpy.o strcspn.o strdup.o \
strerror.o strftime.o stricmp.o strlen.o strlwr.o strncat.o \
strncmp.o strncpy.o strnicmp.o strpbrk.o strrchr.o strrev.o \
strspn.o strstr.o strtok.o strtol.o strtoul.o strupr.o symlink.o \
! sysconf.o system.o sysvar.o \
! textio.o thread.o time.o timeoday.o times.o tmpfile.o tmpnam.o \
! toxxx.o truncate.o ttyname.o \
! uname.o unlink.o unx2dos.o utime.o utmp.o \
! vfork.o vfprintf.o vprintf.o \
! wait.o wait3.o waitpid.o wcmb.o write.o wtmp.o
# Rule to handle .cpp files
.SUFFIXES: .cpp
--- 47,109 ----
# These are in alphabetical order to make it easy to find one.
OBJECTS = \
! a64l.o abort.o abs.o access.o alarm.o alloca.o alphasor.o \
! atexit.o atoi.o atol.o \
bcmp.o bcopy.o binmode.o bsearch.o bzero.o \
! calloc.o cfgetisp.o cfgetosp.o cfsetisp.o cfsetosp.o \
! chdir.o chmod.o chown.o clock.o close.o closedir.o console.o \
! crtinit.o ctermid.o ctime.o ctype.o cuserid.o \
! defmode.o difftime.o div.o doprnt.o \
! do_lock.o do_stat.o dup.o dup2.o \
! eprintf.o execl.o execle.o execp.o execv.o execve.o \
! fclose.o fcntl.o fdopen.o fflush.o \
! ffs.o fgetc.o fgetpos.o fgets.o filbuf.o \
! findfile.o flock.o fopen.o fopen_i.o fopenp.o \
! fork.o fprintf.o fputc.o fputs.o \
! fread.o freopen.o frwbin.o fscanf.o fseek.o fsetpos.o \
! fstat.o ftell.o ftw.o fungetc.o \
fwrite.o \
! getbuf.o getcwd.o getdtabl.o getegid.o geteuid.o getenv.o \
! getgid.o getgroup.o gethostn.o \
! getlogin.o getopt.o getpages.o \
! getpass.o getpid.o getppid.o getpw.o \
! getrusag.o gets.o getuid.o getw.o getwd.o grp.o \
heapbase.o \
! ic.o ident.o ig.o il.o inistack.o initsig.o inode.o ioctl.o ip.o \
! isatty.o isctty.o iw.o \
kill.o killpg.o \
! l64a.o labs.o ldiv.o linea.o link.o lmalloc.o localtim.o \
! lockf.o lseek.o lstat.o ltoa.o \
! main.o malloc.o memccpy.o memchr.o memcmp.o memset.o mkdir.o \
! mkfifo.o mknod.o mktemp.o \
! nice.o nlist.o \
! obstack.o open.o opendir.o osbind.o \
pause.o perror.o pgrp.o pipe.o popen.o printf.o psignal.o putenv.o \
+ putpwent.o puts.o \
qsort.o \
! raise.o rand.o random.o read.o readdir.o \
! realloc.o regexp.o regsup.o \
! rename.o rewind.o rewinddi.o rmdir.o \
! sbrk.o scandir.o scanf.o seekdir.o select.o \
! setbuf.o setegid.o seteuid.o setgid.o setjmp.o setlocal.o \
! setregid.o setreuid.o setrlimi.o setuid.o setvbuf.o sgtty.o \
! sigactio.o sigblock.o siglist.o \
signal.o sleep.o sozolong.o sozulong.o spawn.o spawnve.o \
spawnvp.o sprintf.o sscanf.o stat.o statfs.o stksiz.o strcat.o \
strchr.o strcmp.o strcoll.o strcpy.o strcspn.o strdup.o \
strerror.o strftime.o stricmp.o strlen.o strlwr.o strncat.o \
strncmp.o strncpy.o strnicmp.o strpbrk.o strrchr.o strrev.o \
strspn.o strstr.o strtok.o strtol.o strtoul.o strupr.o symlink.o \
! sync.o sysconf.o system.o sysvar.o \
! tcattr.o tcbreak.o tcdrain.o tcflow.o tcflush.o \
! tcpgrp.o telldir.o textio.o \
! thread.o time.o timeoday.o times.o tmpfile.o tmpnam.o toxxx.o \
! truncate.o ttyname.o \
! uidgid.o uname.o unlink.o unx2dos.o utime.o utmp.o \
! vfork.o vfprintf.o vfscanf.o vprintf.o vscanf.o \
! wait.o wait3.o waitpid.o wcmb.o wcscat.o \
! wcscmp.o wcscpy.o wcslen.o \
! wnull.o write.o wtmp.o
# Rule to handle .cpp files
.SUFFIXES: .cpp
***************
*** 106,117 ****
# Make sure the targets get built if necessary
alloca.o: alloca.cpp
bcopy.o: bcopy.cpp
- bzero.o: bzero.cpp
crt0.o: crt0.cpp
osbind.o: osbind.cpp
setjmp.o: setjmp.cpp
vfork.o: vfork.cpp
# If you're using 1.33i's make or ar, this command will fail spectacularly
# for the first build; you'll have to build it by hand, a few files
# at a time. After that, if you only change a few files at a time,
--- 122,145 ----
# Make sure the targets get built if necessary
alloca.o: alloca.cpp
bcopy.o: bcopy.cpp
crt0.o: crt0.cpp
osbind.o: osbind.cpp
setjmp.o: setjmp.cpp
vfork.o: vfork.cpp
+ # bzero.cpp contains both bzero() and memset().
+ bzero.o: bzero.cpp
+ $(CPP) $(CPPFLAGS) -DLbzero bzero.cpp bzero.i
+ mit2mot bzero.i
+ $(RM) bzero.i
+ $(AS) $(AFLAGS) bzero.s
+
+ memset.o: bzero.cpp
+ $(CPP) $(CPPFLAGS) -DLmemset bzero.cpp memset.i
+ mit2mot memset.i
+ $(RM) memset.i
+ $(AS) $(AFLAGS) memset.s
+
# If you're using 1.33i's make or ar, this command will fail spectacularly
# for the first build; you'll have to build it by hand, a few files
# at a time. After that, if you only change a few files at a time,
*** 43.1 1994/02/15 20:23:28
--- sozobon/readme 1994/02/19 12:50:50
***************
*** 1,4 ****
! MiNT library for Heat-n-Serve/Sozobon C, patchlevel 34
This is a port of Eric Smith's MiNT library to Heat-n-Serve C, based on
Dave Gymer's original port. It replaces the files dlibs.a, dstart.o,
--- 1,4 ----
! MiNT library for Heat-n-Serve/Sozobon C, patchlevel 43
This is a port of Eric Smith's MiNT library to Heat-n-Serve C, based on
Dave Gymer's original port. It replaces the files dlibs.a, dstart.o,
***************
*** 16,22 ****
archives:
mntincXX.zoo
! The library header files for version XX (currently 30). If
you're using the MiNTlibs at all, you should already have these.
mnthlbXX.zoo
The binary distribution of the MiNTlibs. You will need this for
--- 16,22 ----
archives:
mntincXX.zoo
! The library header files for version XX (currently 43). If
you're using the MiNTlibs at all, you should already have these.
mnthlbXX.zoo
The binary distribution of the MiNTlibs. You will need this for
***************
*** 45,53 ****
ps.c
Source for a process listing utility, as an example of MiNT
programming.
- orig/
- Some .s and .c files from previous distributions which are now
- built from .cpp files. You shouldn't need these.
WHAT TO DO WITH IT:
--- 45,50 ----
***************
*** 59,71 ****
somewhere where make can find them.
2) From the main source directory, delete all files beginning with '_',
! as well as linea.c and inistack.c. Copy all the .s files from this
! directory, as well as termcap.c and makefile, to the main source
! directory.
3) Edit osbind.h from the MiNT include distribution. Find the macro
! definitions for trap_14_wllwwwwwlw(), spanning lines 1309-1349 and
! 1456-1500 (or thereabouts). Delete every scrap of white space you
can from these macros. Otherwise, they overrun HSC's static line
buffer.
--- 56,68 ----
somewhere where make can find them.
2) From the main source directory, delete all files beginning with '_',
! as well as alglobal.c, linea.c and inistack.c. Copy all the .s
! files from this directory, as well as termcap.c and makefile, to the
! main source directory.
3) Edit osbind.h from the MiNT include distribution. Find the macro
! definitions for trap_14_wllwwwwwlw(), spanning lines 1318-1358 and
! 1465-1509 (or thereabouts). Delete every scrap of white space you
can from these macros. Otherwise, they overrun HSC's static line
buffer.